feat: load Windows system CA certificates at startup#109
Merged
edospadoni merged 1 commit intomainfrom Mar 19, 2026
Merged
Conversation
Add win-ca to inject Windows Certificate Store CAs into Node.js TLS context on Windows, enabling HTTPS connections to servers using custom/enterprise CA certificates without requiring environment variable workarounds.
|
verified |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Windows, NethLink uses Node.js's built-in TLS stack (via axios) to make HTTPS requests. Node.js does not read the Windows Certificate Store by default, which means installations where the NethVoice server uses a certificate signed by a custom or enterprise CA would fail with
unable to verify the first certificate, even if that CA is correctly installed in the system store.Environment variable workarounds (
NODE_EXTRA_CA_CERTS,NODE_USE_SYSTEM_CA) are either unreliable in packaged Electron apps or require Node.js 24+ (Electron 28 ships Node.js 18).This PR adds the
win-capackage, which reads the Windows Certificate Store at startup and injects all trusted CAs into Node.js's TLS context. The import is guarded by aprocess.platform === 'win32'check so it has no effect on macOS and Linux.Changes
win-cadependencywin-caat the very top ofmain.ts, before any network activity, on Windows only