File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 11const os = require('os');
2+ const https = require("https");
23const axios = require("axios");
34const JSONbig = require("json-bigint")({ storeAsString: false });
45const FormData = require("form-data");
@@ -100,11 +101,6 @@ class Client {
100101 params = {},
101102 responseType = "json"
102103 ) {
103- if (this.selfSigned == true) {
104- // Allow self signed requests
105- process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
106- }
107-
108104 headers = Object.assign({}, this.headers, headers);
109105
110106 let contentType = headers["content-type"].toLowerCase();
@@ -140,6 +136,10 @@ class Client {
140136 transformResponse: [ (data) => data ? JSONbig.parse(data) : data ],
141137 responseType: responseType,
142138 };
139+ if (this.selfSigned == true) {
140+ // Allow self signed requests
141+ options.httpsAgent = new https.Agent({ rejectUnauthorized: false });
142+ }
143143 try {
144144 let response = await axios(options);
145145 if (response.headers["set-cookie"]) {
You can’t perform that action at this time.
0 commit comments