mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-10 00:27:05 -06:00
Adopt @vscode/proxy-agent 0.36.0
This commit is contained in:
parent
e3babad841
commit
29bced6a0d
11
package-lock.json
generated
11
package-lock.json
generated
@ -17,7 +17,7 @@
|
||||
"@vscode/deviceid": "^0.1.1",
|
||||
"@vscode/iconv-lite-umd": "0.7.1",
|
||||
"@vscode/policy-watcher": "^1.3.2",
|
||||
"@vscode/proxy-agent": "^0.35.0",
|
||||
"@vscode/proxy-agent": "^0.36.0",
|
||||
"@vscode/ripgrep": "^1.15.13",
|
||||
"@vscode/spdlog": "^0.15.2",
|
||||
"@vscode/sqlite3": "5.1.8-vscode",
|
||||
@ -3016,9 +3016,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vscode/proxy-agent": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "https://registry.npmjs.org/@vscode/proxy-agent/-/proxy-agent-0.35.0.tgz",
|
||||
"integrity": "sha512-25BxUVwWkRVdVKHIekIz5pshmPprkLmtyPteRIhZIKJF++5u1nLETeHO+a+E957UXnH+YiD2Hh9g9DxVnuBRxA==",
|
||||
"version": "0.36.0",
|
||||
"resolved": "https://registry.npmjs.org/@vscode/proxy-agent/-/proxy-agent-0.36.0.tgz",
|
||||
"integrity": "sha512-W4mls/+zErqTYcKC41utdmoYnBWZRH1dRF9U4cBAyKU5EhcnWfVsPBvUnXXw1CffI3djmMWnu9JrF/Ynw7lkcg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tootallnate/once": "^3.0.0",
|
||||
@ -3029,6 +3029,9 @@
|
||||
"socks-proxy-agent": "^8.0.1",
|
||||
"undici": "^7.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.15.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@vscode/windows-ca-certs": "^0.3.1"
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
"@vscode/deviceid": "^0.1.1",
|
||||
"@vscode/iconv-lite-umd": "0.7.1",
|
||||
"@vscode/policy-watcher": "^1.3.2",
|
||||
"@vscode/proxy-agent": "^0.35.0",
|
||||
"@vscode/proxy-agent": "^0.36.0",
|
||||
"@vscode/ripgrep": "^1.15.13",
|
||||
"@vscode/spdlog": "^0.15.2",
|
||||
"@vscode/sqlite3": "5.1.8-vscode",
|
||||
|
||||
11
remote/package-lock.json
generated
11
remote/package-lock.json
generated
@ -13,7 +13,7 @@
|
||||
"@parcel/watcher": "parcel-bundler/watcher#1ca032aa8339260a8a3bcf825c3a1a71e3e43542",
|
||||
"@vscode/deviceid": "^0.1.1",
|
||||
"@vscode/iconv-lite-umd": "0.7.1",
|
||||
"@vscode/proxy-agent": "^0.35.0",
|
||||
"@vscode/proxy-agent": "^0.36.0",
|
||||
"@vscode/ripgrep": "^1.15.13",
|
||||
"@vscode/spdlog": "^0.15.2",
|
||||
"@vscode/tree-sitter-wasm": "^0.2.0",
|
||||
@ -134,9 +134,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@vscode/proxy-agent": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "https://registry.npmjs.org/@vscode/proxy-agent/-/proxy-agent-0.35.0.tgz",
|
||||
"integrity": "sha512-25BxUVwWkRVdVKHIekIz5pshmPprkLmtyPteRIhZIKJF++5u1nLETeHO+a+E957UXnH+YiD2Hh9g9DxVnuBRxA==",
|
||||
"version": "0.36.0",
|
||||
"resolved": "https://registry.npmjs.org/@vscode/proxy-agent/-/proxy-agent-0.36.0.tgz",
|
||||
"integrity": "sha512-W4mls/+zErqTYcKC41utdmoYnBWZRH1dRF9U4cBAyKU5EhcnWfVsPBvUnXXw1CffI3djmMWnu9JrF/Ynw7lkcg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tootallnate/once": "^3.0.0",
|
||||
@ -147,6 +147,9 @@
|
||||
"socks-proxy-agent": "^8.0.1",
|
||||
"undici": "^7.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.15.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@vscode/windows-ca-certs": "^0.3.1"
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"@parcel/watcher": "parcel-bundler/watcher#1ca032aa8339260a8a3bcf825c3a1a71e3e43542",
|
||||
"@vscode/deviceid": "^0.1.1",
|
||||
"@vscode/iconv-lite-umd": "0.7.1",
|
||||
"@vscode/proxy-agent": "^0.35.0",
|
||||
"@vscode/proxy-agent": "^0.36.0",
|
||||
"@vscode/ripgrep": "^1.15.13",
|
||||
"@vscode/spdlog": "^0.15.2",
|
||||
"@vscode/tree-sitter-wasm": "^0.2.0",
|
||||
|
||||
@ -115,6 +115,7 @@ flakySuite('Native Modules (all platforms)', () => {
|
||||
const proxyAgent = await import('@vscode/proxy-agent');
|
||||
// This call will load `@vscode/proxy-agent` which is a native module that we want to test on Windows
|
||||
const windowsCerts = await proxyAgent.loadSystemCertificates({
|
||||
loadSystemCertificatesFromNode: () => undefined,
|
||||
log: {
|
||||
trace: () => { },
|
||||
debug: () => { },
|
||||
|
||||
@ -264,7 +264,10 @@ function registerProxyConfigurations(useHostProxy = true, useHostProxyDefault =
|
||||
tags: ['experimental'],
|
||||
default: false,
|
||||
markdownDescription: localize('systemCertificatesNode', "Controls whether system certificates should be loaded using Node.js built-in support. Reload the window after changing this setting. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
|
||||
restricted: true
|
||||
restricted: true,
|
||||
experiment: {
|
||||
mode: 'auto'
|
||||
}
|
||||
},
|
||||
'http.experimental.systemCertificatesV2': {
|
||||
type: 'boolean',
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
|
||||
import type * as http from 'http';
|
||||
import type * as https from 'https';
|
||||
import * as tls from 'tls';
|
||||
import { parse as parseUrl } from 'url';
|
||||
import { Promises } from '../../../base/common/async.js';
|
||||
import { streamToBufferReadableStream } from '../../../base/common/buffer.js';
|
||||
@ -119,15 +118,11 @@ export class RequestService extends AbstractRequestService implements IRequestSe
|
||||
}
|
||||
|
||||
async loadCertificates(): Promise<string[]> {
|
||||
const useNodeSystemCerts = this.getConfigValue<boolean>('http.systemCertificatesNode', false);
|
||||
if (useNodeSystemCerts) {
|
||||
const start = Date.now();
|
||||
const systemCerts = tls.getCACertificates('system');
|
||||
this.logService.trace(`RequestService#loadCertificates: Loaded Node.js system certificates (${Date.now() - start}ms):`, systemCerts.length);
|
||||
return systemCerts;
|
||||
}
|
||||
const proxyAgent = await import('@vscode/proxy-agent');
|
||||
return proxyAgent.loadSystemCertificates({ log: this.logService });
|
||||
return proxyAgent.loadSystemCertificates({
|
||||
loadSystemCertificatesFromNode: () => this.getConfigValue<boolean>('http.systemCertificatesNode', false),
|
||||
log: this.logService,
|
||||
});
|
||||
}
|
||||
|
||||
private getConfigValue<T>(key: string, fallback?: T): T | undefined {
|
||||
|
||||
@ -54,6 +54,7 @@ export function connectProxyResolver(
|
||||
isAdditionalFetchSupportEnabled: () => getExtHostConfigValue<boolean>(configProvider, isRemote, 'http.fetchAdditionalSupport', true),
|
||||
addCertificatesV1: () => certSettingV1(configProvider, isRemote),
|
||||
addCertificatesV2: () => certSettingV2(configProvider, isRemote),
|
||||
loadSystemCertificatesFromNode: () => getExtHostConfigValue<boolean>(configProvider, isRemote, 'http.systemCertificatesNode', false),
|
||||
log: extHostLogService,
|
||||
getLogLevel: () => {
|
||||
const level = extHostLogService.getLevel();
|
||||
@ -81,21 +82,17 @@ export function connectProxyResolver(
|
||||
const useNodeSystemCerts = getExtHostConfigValue<boolean>(configProvider, isRemote, 'http.systemCertificatesNode', false);
|
||||
const promises: Promise<string[]>[] = [];
|
||||
if (isRemote) {
|
||||
if (useNodeSystemCerts) {
|
||||
const start = Date.now();
|
||||
const systemCerts = tls.getCACertificates('system');
|
||||
extHostLogService.trace(`ProxyResolver#loadAdditionalCertificates: Loaded Node.js system certificates (${Date.now() - start}ms):`, systemCerts.length);
|
||||
promises.push(Promise.resolve(systemCerts));
|
||||
} else {
|
||||
promises.push(loadSystemCertificates({ log: extHostLogService }));
|
||||
}
|
||||
promises.push(loadSystemCertificates({
|
||||
loadSystemCertificatesFromNode: () => useNodeSystemCerts,
|
||||
log: extHostLogService,
|
||||
}));
|
||||
}
|
||||
if (loadLocalCertificates) {
|
||||
if (!isRemote && useNodeSystemCerts) {
|
||||
const start = Date.now();
|
||||
const systemCerts = tls.getCACertificates('system');
|
||||
extHostLogService.trace(`ProxyResolver#loadAdditionalCertificates: Loaded Node.js system certificates (${Date.now() - start}ms):`, systemCerts.length);
|
||||
promises.push(Promise.resolve(systemCerts));
|
||||
promises.push(loadSystemCertificates({
|
||||
loadSystemCertificatesFromNode: () => useNodeSystemCerts,
|
||||
log: extHostLogService,
|
||||
}));
|
||||
} else {
|
||||
extHostLogService.trace('ProxyResolver#loadAdditionalCertificates: Loading certificates from main process');
|
||||
const certs = extHostWorkspace.loadCertificates(); // Loading from main process to share cache.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user