diff --git a/packages/core/src/shared/utilities/proxyUtil.ts b/packages/core/src/shared/utilities/proxyUtil.ts index f03c2b18a5e..06150b9fc01 100644 --- a/packages/core/src/shared/utilities/proxyUtil.ts +++ b/packages/core/src/shared/utilities/proxyUtil.ts @@ -5,9 +5,6 @@ import vscode from 'vscode' import { getLogger } from '../logger/logger' -import { tmpdir } from 'os' -import { join } from 'path' -import * as nodefs from 'fs' // eslint-disable-line no-restricted-imports interface ProxyConfig { proxyUrl: string | undefined @@ -73,9 +70,6 @@ export class ProxyUtil { // Always enable experimental proxy support for better handling of both explicit and transparent proxies process.env.EXPERIMENTAL_HTTP_PROXY_SUPPORT = 'true' - // Load built-in bundle and system OS trust store - process.env.NODE_OPTIONS = '--use-system-ca' - const proxyUrl = config.proxyUrl // Set proxy environment variables if (proxyUrl) { @@ -104,41 +98,6 @@ export class ProxyUtil { process.env.NODE_EXTRA_CA_CERTS = config.certificateAuthority process.env.AWS_CA_BUNDLE = config.certificateAuthority this.logger.debug(`Set certificate bundle path: ${config.certificateAuthority}`) - } else { - // Fallback to system certificates if no custom CA is configured - await this.setSystemCertificates() - } - } - - /** - * Sets system certificates as fallback when no custom CA is configured - */ - private static async setSystemCertificates(): Promise { - try { - const tls = await import('tls') - // @ts-ignore Get system certificates - const systemCerts = tls.getCACertificates('system') - // @ts-ignore Get any existing extra certificates - const extraCerts = tls.getCACertificates('extra') - const allCerts = [...systemCerts, ...extraCerts] - if (allCerts && allCerts.length > 0) { - this.logger.debug(`Found ${allCerts.length} certificates in system's trust store`) - - const tempDir = join(tmpdir(), 'aws-toolkit-vscode') - if (!nodefs.existsSync(tempDir)) { - nodefs.mkdirSync(tempDir, { recursive: true }) - } - - const certPath = join(tempDir, 'vscode-ca-certs.pem') - const certContent = allCerts.join('\n') - - nodefs.writeFileSync(certPath, certContent) - process.env.NODE_EXTRA_CA_CERTS = certPath - process.env.AWS_CA_BUNDLE = certPath - this.logger.debug(`Set system certificate bundle path: ${certPath}`) - } - } catch (err) { - this.logger.error(`Failed to extract system certificates: ${err}`) } } }