Skip to content

Commit 7626187

Browse files
Merge pull request #70 from gjsjohnmurray/fix-67
Respect `http.proxyStrictSSL` setting
2 parents 8ae4019 + cd260d6 commit 7626187

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export async function activate(extContext: ExtensionContext): Promise<IDriverExt
159159
password: connSpec.password,
160160
namespace,
161161
resultSetRowLimit,
162+
rejectUnauthorized: vscode.workspace.getConfiguration("http").get("proxyStrictSSL"),
162163
}
163164
}
164165
return connInfo;

src/ls/driver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class IRISDriver extends AbstractDriver<IRISdb, DriverOptions> im
2727
this.showSystem = this.credentials.showSystem || false;
2828
this.filter = this.credentials.filter || "";
2929

30-
let { https, server: host, port, pathPrefix, username, password, resultSetRowLimit } = this.credentials;
30+
let { https, server: host, port, pathPrefix, username, password, resultSetRowLimit, rejectUnauthorized } = this.credentials;
3131
config = {
3232
https,
3333
host,
@@ -39,7 +39,7 @@ export default class IRISDriver extends AbstractDriver<IRISdb, DriverOptions> im
3939
};
4040
this.resultSetRowLimit = resultSetRowLimit;
4141

42-
const irisdb = new IRISdb(config, resultSetRowLimit);
42+
const irisdb = new IRISdb(config, resultSetRowLimit, rejectUnauthorized);
4343
return irisdb.open()
4444
.then(() => {
4545
this.connection = Promise.resolve(irisdb);

src/ls/irisdb.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@ export default class IRISdb {
2727

2828
private config: IRISDirect;
2929
private resultSetRowLimit: number;
30+
private rejectUnauthorized: boolean;
3031
private cookies: string[] = [];
3132
private _apiVersion = 1;
3233

3334
public get apiVersion() {
3435
return this._apiVersion;
3536
}
3637

37-
public constructor(config: IRISDirect, resultSetRowLimit: number) {
38+
public constructor(config: IRISDirect, resultSetRowLimit: number, rejectUnauthorized: boolean = true) {
3839
this.config = config;
3940
this.config.namespace = this.config.namespace.toUpperCase();
4041
this.resultSetRowLimit = resultSetRowLimit;
42+
this.rejectUnauthorized = rejectUnauthorized;
4143
}
4244

4345
public updateCookies(newCookies: string[]): void {
@@ -99,7 +101,7 @@ export default class IRISdb {
99101
const agent = new (https ? httpsModule : httpModule).Agent({
100102
keepAlive: true,
101103
maxSockets: 10,
102-
rejectUnauthorized: https,
104+
rejectUnauthorized: this.rejectUnauthorized,
103105
});
104106
path = encodeURI(`${pathPrefix || ""}/api/atelier/${path || ""}${buildParams()}`);
105107

0 commit comments

Comments
 (0)