|
5 | 5 |
|
6 | 6 | import vscode from 'vscode'
|
7 | 7 | import { getLogger } from '../logger/logger'
|
8 |
| -import { tmpdir } from 'os' |
9 |
| -import { join } from 'path' |
10 |
| -import * as nodefs from 'fs' // eslint-disable-line no-restricted-imports |
11 | 8 |
|
12 | 9 | interface ProxyConfig {
|
13 | 10 | proxyUrl: string | undefined
|
@@ -73,9 +70,6 @@ export class ProxyUtil {
|
73 | 70 | // Always enable experimental proxy support for better handling of both explicit and transparent proxies
|
74 | 71 | process.env.EXPERIMENTAL_HTTP_PROXY_SUPPORT = 'true'
|
75 | 72 |
|
76 |
| - // Load built-in bundle and system OS trust store |
77 |
| - process.env.NODE_OPTIONS = '--use-system-ca' |
78 |
| - |
79 | 73 | const proxyUrl = config.proxyUrl
|
80 | 74 | // Set proxy environment variables
|
81 | 75 | if (proxyUrl) {
|
@@ -104,41 +98,6 @@ export class ProxyUtil {
|
104 | 98 | process.env.NODE_EXTRA_CA_CERTS = config.certificateAuthority
|
105 | 99 | process.env.AWS_CA_BUNDLE = config.certificateAuthority
|
106 | 100 | this.logger.debug(`Set certificate bundle path: ${config.certificateAuthority}`)
|
107 |
| - } else { |
108 |
| - // Fallback to system certificates if no custom CA is configured |
109 |
| - await this.setSystemCertificates() |
110 |
| - } |
111 |
| - } |
112 |
| - |
113 |
| - /** |
114 |
| - * Sets system certificates as fallback when no custom CA is configured |
115 |
| - */ |
116 |
| - private static async setSystemCertificates(): Promise<void> { |
117 |
| - try { |
118 |
| - const tls = await import('tls') |
119 |
| - // @ts-ignore Get system certificates |
120 |
| - const systemCerts = tls.getCACertificates('system') |
121 |
| - // @ts-ignore Get any existing extra certificates |
122 |
| - const extraCerts = tls.getCACertificates('extra') |
123 |
| - const allCerts = [...systemCerts, ...extraCerts] |
124 |
| - if (allCerts && allCerts.length > 0) { |
125 |
| - this.logger.debug(`Found ${allCerts.length} certificates in system's trust store`) |
126 |
| - |
127 |
| - const tempDir = join(tmpdir(), 'aws-toolkit-vscode') |
128 |
| - if (!nodefs.existsSync(tempDir)) { |
129 |
| - nodefs.mkdirSync(tempDir, { recursive: true }) |
130 |
| - } |
131 |
| - |
132 |
| - const certPath = join(tempDir, 'vscode-ca-certs.pem') |
133 |
| - const certContent = allCerts.join('\n') |
134 |
| - |
135 |
| - nodefs.writeFileSync(certPath, certContent) |
136 |
| - process.env.NODE_EXTRA_CA_CERTS = certPath |
137 |
| - process.env.AWS_CA_BUNDLE = certPath |
138 |
| - this.logger.debug(`Set system certificate bundle path: ${certPath}`) |
139 |
| - } |
140 |
| - } catch (err) { |
141 |
| - this.logger.error(`Failed to extract system certificates: ${err}`) |
142 | 101 | }
|
143 | 102 | }
|
144 | 103 | }
|
0 commit comments