From ca1d549409ef96c53562ebf4233d4919ac3ee4eb Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Fri, 15 Sep 2023 12:43:15 +0200 Subject: [PATCH] Update @vscode/proxy-agent and enable new cert loading --- package.json | 2 +- remote/package.json | 2 +- remote/yarn.lock | 5 ++--- src/vs/workbench/api/node/proxyResolver.ts | 22 ++++++++++++++++++---- yarn.lock | 5 ++--- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 8e9dd05a1b216..16c7f9406027a 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "@parcel/watcher": "2.1.0", "@vscode/iconv-lite-umd": "0.7.0", "@vscode/policy-watcher": "^1.1.4", - "@vscode/proxy-agent": "^0.17.2", + "@vscode/proxy-agent": "https://github.com/microsoft/vscode-proxy-agent.git#1b16158bafe320ae2459385450270bf7999d42a7", "@vscode/ripgrep": "^1.15.5", "@vscode/spdlog": "^0.13.11", "@vscode/sqlite3": "5.1.6-vscode", diff --git a/remote/package.json b/remote/package.json index 50c98b47a4897..565881ec5cab0 100644 --- a/remote/package.json +++ b/remote/package.json @@ -7,7 +7,7 @@ "@microsoft/1ds-post-js": "^3.2.13", "@parcel/watcher": "2.1.0", "@vscode/iconv-lite-umd": "0.7.0", - "@vscode/proxy-agent": "^0.17.2", + "@vscode/proxy-agent": "https://github.com/microsoft/vscode-proxy-agent.git#1b16158bafe320ae2459385450270bf7999d42a7", "@vscode/ripgrep": "^1.15.5", "@vscode/spdlog": "^0.13.11", "@vscode/vscode-languagedetection": "1.0.21", diff --git a/remote/yarn.lock b/remote/yarn.lock index 1771063a82c02..a29cf6234dc32 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -58,10 +58,9 @@ resolved "https://registry.yarnpkg.com/@vscode/iconv-lite-umd/-/iconv-lite-umd-0.7.0.tgz#d2f1e0664ee6036408f9743fee264ea0699b0e48" integrity sha512-bRRFxLfg5dtAyl5XyiVWz/ZBPahpOpPrNYnnHpOpUZvam4tKH35wdhP4Kj6PbM0+KdliOsPzbGWpkxcdpNB/sg== -"@vscode/proxy-agent@^0.17.2": +"@vscode/proxy-agent@https://github.com/microsoft/vscode-proxy-agent.git#1b16158bafe320ae2459385450270bf7999d42a7": version "0.17.2" - resolved "https://registry.yarnpkg.com/@vscode/proxy-agent/-/proxy-agent-0.17.2.tgz#0e0dac24478e2d71a4fd1b2bb5f84dc61add79e2" - integrity sha512-aKRo1YfUCsgEjHvr2HXfM6dwHhieyO6G+WHly7jewyyTJ1nANWEocS3JRnRbC4KjlajKhSUEOx838cdnY/vRtA== + resolved "https://github.com/microsoft/vscode-proxy-agent.git#1b16158bafe320ae2459385450270bf7999d42a7" dependencies: "@tootallnate/once" "^3.0.0" agent-base "^7.0.1" diff --git a/src/vs/workbench/api/node/proxyResolver.ts b/src/vs/workbench/api/node/proxyResolver.ts index 6c0cd980ced8f..b88134375782a 100644 --- a/src/vs/workbench/api/node/proxyResolver.ts +++ b/src/vs/workbench/api/node/proxyResolver.ts @@ -14,11 +14,11 @@ import { MainThreadTelemetryShape } from 'vs/workbench/api/common/extHost.protoc import { IExtensionHostInitData } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionService'; import { URI } from 'vs/base/common/uri'; -import { ILogService } from 'vs/platform/log/common/log'; +import { ILogService, LogLevel as LogServiceLevel } from 'vs/platform/log/common/log'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { LogLevel, createHttpPatch, createProxyResolver, createTlsPatch, ProxySupportSetting, ProxyAgentParams, createNetPatch } from '@vscode/proxy-agent'; -const systemCertificatesV2Default = false; +const systemCertificatesV2Default = true; export function connectProxyResolver( extHostWorkspace: IExtHostWorkspaceProvider, @@ -53,8 +53,22 @@ export function connectProxyResolver( extHostLogService.error(message, ...args); } }, - getLogLevel: () => extHostLogService.getLevel(), - // TODO @chrmarti Remove this from proxy agent + getLogLevel: () => { + const level = extHostLogService.getLevel(); + switch (level) { + case LogServiceLevel.Trace: return LogLevel.Trace; + case LogServiceLevel.Debug: return LogLevel.Debug; + case LogServiceLevel.Info: return LogLevel.Info; + case LogServiceLevel.Warning: return LogLevel.Warning; + case LogServiceLevel.Error: return LogLevel.Error; + case LogServiceLevel.Off: return LogLevel.Off; + default: return never(level); + } + function never(level: never) { + extHostLogService.error('Unknown log level', level); + return LogLevel.Debug; + } + }, proxyResolveTelemetry: () => { }, useHostProxy: doUseHostProxy, addCertificates: [], diff --git a/yarn.lock b/yarn.lock index cf5b0450563ca..c8eed4fc068be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1304,10 +1304,9 @@ bindings "^1.5.0" node-addon-api "^6.0.0" -"@vscode/proxy-agent@^0.17.2": +"@vscode/proxy-agent@https://github.com/microsoft/vscode-proxy-agent.git#1b16158bafe320ae2459385450270bf7999d42a7": version "0.17.2" - resolved "https://registry.yarnpkg.com/@vscode/proxy-agent/-/proxy-agent-0.17.2.tgz#0e0dac24478e2d71a4fd1b2bb5f84dc61add79e2" - integrity sha512-aKRo1YfUCsgEjHvr2HXfM6dwHhieyO6G+WHly7jewyyTJ1nANWEocS3JRnRbC4KjlajKhSUEOx838cdnY/vRtA== + resolved "https://github.com/microsoft/vscode-proxy-agent.git#1b16158bafe320ae2459385450270bf7999d42a7" dependencies: "@tootallnate/once" "^3.0.0" agent-base "^7.0.1"