-
Notifications
You must be signed in to change notification settings - Fork 747
fix(amazonq): allow node to inherit proxy settings from VSC #7505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
9210fff to
79a6364
Compare
|
|
||
| try { | ||
| // Check if user already has NODE_EXTRA_CA_CERTS set | ||
| const userCerts = process.env.NODE_EXTRA_CA_CERTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this works correctly on mac -- see discussion in jetbrains/eclipse where macOS does not inherit the console environment due to how app launching works
|
|
||
| try { | ||
| // @ts-ignore - we need this function to access certs | ||
| const certs = tls.getCACertificates() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure how this would work. the default behavior is to use the node bundled CAs, which is not what we want. should this be explicitly system? or does this just magically work because VSC is patching the return value?
Problem
With the introduction of agentic chat, Amazon Q Developer now runs its language server (Flare) in a separate Node.js process outside of VS Code's control. This creates network connectivity issues in corporate environments:
The Node.js process doesn't inherit VS Code's proxy settings, causing connection failures behind corporate proxies
Corporate SSL certificates aren't trusted by the Node.js process, resulting in certificate validation errors
Proxy authentication (including Integrated Windows Authentication) doesn't work automatically
These issues prevent Amazon Q Developer from functioning in enterprise environments with strict network policies.
Solution
This PR enables the Flare Language Server to inherit VS Code's Electron proxy settings and certificate trust store:
Added a getElectronSettings() function that extracts:
Proxy rules from Electron's session
Proxy bypass rules for local addresses
Trusted certificates from Electron's certificate store
Modified createServerOptions() to:
Apply Electron's proxy settings to the Node.js process environment
Pass trusted certificates to Node.js via NODE_EXTRA_CA_CERTS
Preserve proxy bypass rules via NO_PROXY
Simplified the proxy environment setup in baseLspInstaller.ts to focus on SSL verification settings
This approach ensures that the Node.js process uses the same proxy configuration and certificate trust store as VS Code, making Amazon Q Developer work transparently in corporate environments without requiring manual configuration.
feature/xbranches will not be squash-merged at release time.feature/xbranches will not be squash-merged at release time.