@@ -3,6 +3,7 @@ import axiosCookieJarSupport from "axios-cookiejar-support";
33import tough = require( "tough-cookie" ) ;
44import * as vscode from "vscode" ;
55import { IServerSpec } from "./extension" ;
6+ import * as https from 'https' ;
67
78const AUTHENTICATION_PROVIDER = "intersystems-server-credentials" ;
89
@@ -34,6 +35,9 @@ export async function makeRESTRequest(
3435 data ?: any ,
3536 ) : Promise < AxiosResponse | undefined > {
3637
38+ // Create the HTTPS agent
39+ const httpsAgent = new https . Agent ( { rejectUnauthorized : vscode . workspace . getConfiguration ( "http" ) . get ( "proxyStrictSSL" ) } ) ;
40+
3741 // Build the URL
3842 let url = server . webServer . scheme + "://" + server . webServer . host + ":" + String ( server . webServer . port ) ;
3943 const pathPrefix = server . webServer . pathPrefix ;
@@ -52,6 +56,7 @@ export async function makeRESTRequest(
5256 // There is a data payload
5357 respdata = await axios . request (
5458 {
59+ httpsAgent,
5560 data,
5661 headers : {
5762 "Content-Type" : "application/json" ,
@@ -72,6 +77,7 @@ export async function makeRESTRequest(
7277 // Either we had no cookies or they expired, so resend the request with basic auth
7378 respdata = await axios . request (
7479 {
80+ httpsAgent,
7581 auth : {
7682 password : server . password ,
7783 username : server . username ,
@@ -92,6 +98,7 @@ export async function makeRESTRequest(
9298 // No data payload
9399 respdata = await axios . request (
94100 {
101+ httpsAgent,
95102 jar : cookieJar ,
96103 method,
97104 url : encodeURI ( url ) ,
@@ -108,6 +115,7 @@ export async function makeRESTRequest(
108115 // Either we had no cookies or they expired, so resend the request with basic auth
109116 respdata = await axios . request (
110117 {
118+ httpsAgent,
111119 auth : {
112120 password : server . password ,
113121 username : server . username ,
0 commit comments