✨ Add NODE_EXTRA_CA_CERT support for fetch #1053
Open
+231
−23
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.
Fix: Binary Download Failures Behind Corporate Firewalls/Proxies
Problem
Users behind corporate firewalls with SSL-inspecting proxies were experiencing binary download failures during extension activation:
Root Causes
No Proxy Support in Binary Downloads: The
ensureKaiAnalyzerBinary()function inpaths.tswas using plainfetch()without any proxy configuration, causing downloads to fail when users hadHTTPS_PROXYenvironment variables set.Custom CA Certificates Not Respected: When enterprises use SSL-inspecting proxies, they issue their own certificates. The download code wasn't loading custom CA certificates specified via
NODE_EXTRA_CA_CERTS.Proxy Authentication Ignored: Due to undici issue #1674, credentials in proxy URLs like
http://username:[email protected]:8080were being ignored, causing407 Proxy Authentication Requirederrors.Solution
1. Added Proxy Support to Binary Downloads (
paths.ts)getDispatcherWithCertBundle()andgetFetchWithDispatcher()fromutilities/tls.tsHTTPS_PROXYenvironment variables andNODE_EXTRA_CA_CERTSBefore:
After:
2. Added Proxy Authentication Support (
utilities/tls.ts)Implemented the workaround from undici issue #1674 to handle credentials in proxy URLs:
ProxyAgentvia theauthoptionSupported Proxy Configurations
This fix now supports:
✅ Explicit Proxy (most common):
✅ Proxy with Authentication:
✅ Transparent Proxy (WireGuard/network-level):
Impact
This fix resolves download failures for users in:
Related Issues
UNABLE_TO_VERIFY_LEAF_SIGNATUREUND_ERR_ABORTEDerrors behind proxiesFiles Changed
editor-extensions/vscode/src/paths.ts: Added proxy support to binary downloadseditor-extensions/vscode/src/utilities/tls.ts: Added proxy authentication supportBreaking Changes
None. This is a backward-compatible fix that adds support for proxy configurations without affecting existing functionality.