Skip to content

Commit 674e1b3

Browse files
Merge pull request #969 from DustinCampbell/v1.5.3
Cherry pick strictSSL fix and create 1.5.3
2 parents f57b8b0 + 21fdb15 commit 674e1b3

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ The C# extension is powered by [OmniSharp](https://github.com/OmniSharp/omnishar
1818
* [Documentation](https://code.visualstudio.com/docs/languages/csharp)
1919
* [Video Tutorial compiling with .NET Core](https://channel9.msdn.com/Blogs/dotnet/Get-started-with-VS-Code-using-CSharp-and-NET-Core)
2020

21+
### What's New in 1.5.3
22+
23+
* Use value of `http.proxyStrictSSL` even when `http.proxy` is not set. ([#957](https://github.com/OmniSharp/omnisharp-vscode/issues/957))
24+
2125
### What's New in 1.5.2
2226

2327
* Ensure diagnostics are cleared in files when they are no longer needed. ([#858](https://github.com/OmniSharp/omnisharp-vscode/issues/858))

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "csharp",
33
"publisher": "ms-vscode",
4-
"version": "1.5.2",
4+
"version": "1.5.3",
55
"description": "C# for Visual Studio Code (powered by OmniSharp).",
66
"displayName": "C#",
77
"author": "Microsoft Corporation",

src/common.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export function getBinPath() {
2525
return path.resolve(getExtensionPath(), "bin");
2626
}
2727

28+
export function isBoolean(obj: any): obj is boolean {
29+
return obj === true || obj === false;
30+
}
31+
2832
export function buildPromiseChain<T, TResult>(array: T[], builder: (item: T) => Promise<TResult>): Promise<TResult> {
2933
return array.reduce(
3034
(promise, n) => promise.then(() => builder(n)),

src/packages.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ function downloadFile(urlString: string, pkg: Package, logger: Logger, status: S
173173
const options: https.RequestOptions = {
174174
host: url.host,
175175
path: url.path,
176-
agent: getProxyAgent(url, proxy, strictSSL)
176+
agent: getProxyAgent(url, proxy, strictSSL),
177+
rejectUnauthorized: util.isBoolean(strictSSL) ? strictSSL : true
177178
};
178179

179180
return new Promise<void>((resolve, reject) => {

src/proxy.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
'use strict';
77

88
import { Url, parse as parseUrl } from 'url';
9+
import { isBoolean } from './common';
910
import HttpProxyAgent = require('http-proxy-agent');
1011
import HttpsProxyAgent = require('https-proxy-agent');
1112

@@ -32,15 +33,11 @@ export function getProxyAgent(requestURL: Url, proxy: string, strictSSL: boolean
3233
return null;
3334
}
3435

35-
if (strictSSL === undefined) {
36-
strictSSL = true;
37-
}
38-
3936
const opts = {
4037
host: proxyEndpoint.hostname,
4138
port: Number(proxyEndpoint.port),
4239
auth: proxyEndpoint.auth,
43-
rejectUnauthorized: strictSSL
40+
rejectUnauthorized: isBoolean(strictSSL) ? strictSSL : true
4441
};
4542

4643
return requestURL.protocol === 'http:' ? new HttpProxyAgent(opts) : new HttpsProxyAgent(opts);

0 commit comments

Comments
 (0)