diff --git a/packages/amazonq/package.json b/packages/amazonq/package.json index 73d6b8c06b0..12bd4143389 100644 --- a/packages/amazonq/package.json +++ b/packages/amazonq/package.json @@ -219,6 +219,11 @@ "markdownDescription": "%AWS.configuration.description.amazonq.proxy.certificateAuthority%", "default": null, "scope": "application" + }, + "amazonQ.proxy.enableProxyAndCertificateAutoDiscovery": { + "type": "boolean", + "markdownDescription": "%AWS.configuration.description.amazonq.proxy.enableProxyAndCertificateAutoDiscovery%", + "default": true } } }, diff --git a/packages/core/package.nls.json b/packages/core/package.nls.json index 06343f17c75..fa5f102e7c8 100644 --- a/packages/core/package.nls.json +++ b/packages/core/package.nls.json @@ -99,6 +99,7 @@ "AWS.configuration.description.amazonq.workspaceIndexCacheDirPath": "The path to the directory that contains the cache of the index of your workspace files", "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.", "AWS.configuration.description.amazonq.proxy.certificateAuthority": "Path to a Certificate Authority (PEM file) for SSL/TLS verification when using a proxy.", + "AWS.configuration.description.amazonq.proxy.enableProxyAndCertificateAutoDiscovery": "Automatically detect system proxy settings and SSL certificates.", "AWS.command.apig.invokeRemoteRestApi": "Invoke remotely", "AWS.command.apig.invokeRemoteRestApi.cn": "Invoke on Amazon", "AWS.appBuilder.explorerTitle": "Application Builder", diff --git a/packages/core/src/shared/settings-amazonq.gen.ts b/packages/core/src/shared/settings-amazonq.gen.ts index 836b68444f2..2ca8481b55e 100644 --- a/packages/core/src/shared/settings-amazonq.gen.ts +++ b/packages/core/src/shared/settings-amazonq.gen.ts @@ -37,7 +37,8 @@ export const amazonqSettings = { "amazonQ.workspaceIndexCacheDirPath": {}, "amazonQ.workspaceIndexIgnoreFilePatterns": {}, "amazonQ.ignoredSecurityIssues": {}, - "amazonQ.proxy.certificateAuthority": {} + "amazonQ.proxy.certificateAuthority": {}, + "amazonQ.proxy.enableProxyAndCertificateAutoDiscovery": {} } export default amazonqSettings diff --git a/packages/core/src/shared/utilities/proxyUtil.ts b/packages/core/src/shared/utilities/proxyUtil.ts index fc38b3e7e0d..e617bcd85c3 100644 --- a/packages/core/src/shared/utilities/proxyUtil.ts +++ b/packages/core/src/shared/utilities/proxyUtil.ts @@ -11,6 +11,7 @@ interface ProxyConfig { noProxy: string | undefined proxyStrictSSL: boolean | true certificateAuthority: string | undefined + isProxyAndCertAutoDiscoveryEnabled: boolean } /** @@ -53,13 +54,15 @@ export class ProxyUtil { const amazonQConfig = vscode.workspace.getConfiguration('amazonQ') const proxySettings = amazonQConfig.get<{ certificateAuthority?: string - }>('proxy', {}) + enableProxyAndCertificateAutoDiscovery: boolean + }>('proxy', { enableProxyAndCertificateAutoDiscovery: true }) return { proxyUrl, noProxy, proxyStrictSSL, certificateAuthority: proxySettings.certificateAuthority, + isProxyAndCertAutoDiscoveryEnabled: proxySettings.enableProxyAndCertificateAutoDiscovery, } } @@ -67,8 +70,8 @@ export class ProxyUtil { * Sets environment variables based on proxy configuration */ private static async setProxyEnvironmentVariables(config: ProxyConfig): Promise { - // Always enable experimental proxy support for better handling of both explicit and transparent proxies - process.env.EXPERIMENTAL_HTTP_PROXY_SUPPORT = 'false' + // Set experimental proxy support based on user setting + process.env.EXPERIMENTAL_HTTP_PROXY_SUPPORT = config.isProxyAndCertAutoDiscoveryEnabled.toString() const proxyUrl = config.proxyUrl // Set proxy environment variables