Skip to content

fix(amazonq): add flag in settings for controlling experimental proxy support #7923

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

Merged
merged 1 commit into from
Aug 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/amazonq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
},
Expand Down
1 change: 1 addition & 0 deletions packages/core/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/shared/settings-amazonq.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 6 additions & 3 deletions packages/core/src/shared/utilities/proxyUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface ProxyConfig {
noProxy: string | undefined
proxyStrictSSL: boolean | true
certificateAuthority: string | undefined
isProxyAndCertAutoDiscoveryEnabled: boolean
}

/**
Expand Down Expand Up @@ -53,22 +54,24 @@ 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,
}
}

/**
* Sets environment variables based on proxy configuration
*/
private static async setProxyEnvironmentVariables(config: ProxyConfig): Promise<void> {
// 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
Expand Down
Loading