Skip to content

Commit 4dfb659

Browse files
authored
fix(amazonq): add flag in settings for controlling experimental proxy support (#7923)
## Problem The proxy and certificate auto-discovery code occasionally causes issues and there is a need to allow control of this by users. ## Solution Add a checkbox in settings that allow customers to control whether they want Amazon Q's proxy and certificate auto-discovery turned on. ## Testing Experimental proxy util used once setting enabled: <img width="438" height="111" alt="Screenshot 2025-08-19 at 10 49 11 AM" src="https://github.com/user-attachments/assets/bafbc879-41db-4ad7-a164-bb8bb2655de0" /> Standard proxy util used once setting disabled: <img width="438" height="111" alt="Screenshot 2025-08-19 at 10 50 05 AM" src="https://github.com/user-attachments/assets/d38c4a25-ea9b-41be-8b04-25cbc13f49ec" /> --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent b4aae3f commit 4dfb659

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

packages/amazonq/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@
219219
"markdownDescription": "%AWS.configuration.description.amazonq.proxy.certificateAuthority%",
220220
"default": null,
221221
"scope": "application"
222+
},
223+
"amazonQ.proxy.enableProxyAndCertificateAutoDiscovery": {
224+
"type": "boolean",
225+
"markdownDescription": "%AWS.configuration.description.amazonq.proxy.enableProxyAndCertificateAutoDiscovery%",
226+
"default": true
222227
}
223228
}
224229
},

packages/core/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
"AWS.configuration.description.amazonq.workspaceIndexCacheDirPath": "The path to the directory that contains the cache of the index of your workspace files",
100100
"AWS.configuration.description.amazonq.ignoredSecurityIssues": "Specifies a list of code issue identifiers that Amazon Q should ignore when reviewing your workspace. Each item in the array should be a unique string identifier for a specific code issue. This allows you to suppress notifications for known issues that you've assessed and determined to be false positives or not applicable to your project. Use this setting with caution, as it may cause you to miss important security alerts.",
101101
"AWS.configuration.description.amazonq.proxy.certificateAuthority": "Path to a Certificate Authority (PEM file) for SSL/TLS verification when using a proxy.",
102+
"AWS.configuration.description.amazonq.proxy.enableProxyAndCertificateAutoDiscovery": "Automatically detect system proxy settings and SSL certificates.",
102103
"AWS.command.apig.invokeRemoteRestApi": "Invoke remotely",
103104
"AWS.command.apig.invokeRemoteRestApi.cn": "Invoke on Amazon",
104105
"AWS.appBuilder.explorerTitle": "Application Builder",

packages/core/src/shared/settings-amazonq.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export const amazonqSettings = {
3737
"amazonQ.workspaceIndexCacheDirPath": {},
3838
"amazonQ.workspaceIndexIgnoreFilePatterns": {},
3939
"amazonQ.ignoredSecurityIssues": {},
40-
"amazonQ.proxy.certificateAuthority": {}
40+
"amazonQ.proxy.certificateAuthority": {},
41+
"amazonQ.proxy.enableProxyAndCertificateAutoDiscovery": {}
4142
}
4243

4344
export default amazonqSettings

packages/core/src/shared/utilities/proxyUtil.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface ProxyConfig {
1111
noProxy: string | undefined
1212
proxyStrictSSL: boolean | true
1313
certificateAuthority: string | undefined
14+
isProxyAndCertAutoDiscoveryEnabled: boolean
1415
}
1516

1617
/**
@@ -53,22 +54,24 @@ export class ProxyUtil {
5354
const amazonQConfig = vscode.workspace.getConfiguration('amazonQ')
5455
const proxySettings = amazonQConfig.get<{
5556
certificateAuthority?: string
56-
}>('proxy', {})
57+
enableProxyAndCertificateAutoDiscovery: boolean
58+
}>('proxy', { enableProxyAndCertificateAutoDiscovery: true })
5759

5860
return {
5961
proxyUrl,
6062
noProxy,
6163
proxyStrictSSL,
6264
certificateAuthority: proxySettings.certificateAuthority,
65+
isProxyAndCertAutoDiscoveryEnabled: proxySettings.enableProxyAndCertificateAutoDiscovery,
6366
}
6467
}
6568

6669
/**
6770
* Sets environment variables based on proxy configuration
6871
*/
6972
private static async setProxyEnvironmentVariables(config: ProxyConfig): Promise<void> {
70-
// Always enable experimental proxy support for better handling of both explicit and transparent proxies
71-
process.env.EXPERIMENTAL_HTTP_PROXY_SUPPORT = 'false'
73+
// Set experimental proxy support based on user setting
74+
process.env.EXPERIMENTAL_HTTP_PROXY_SUPPORT = config.isProxyAndCertAutoDiscoveryEnabled.toString()
7275

7376
const proxyUrl = config.proxyUrl
7477
// Set proxy environment variables

0 commit comments

Comments
 (0)