Skip to content

Commit

Permalink
test rejectUnauthorized
Browse files Browse the repository at this point in the history
  • Loading branch information
sponzillo committed Dec 2, 2021
1 parent 5638efe commit 08d8a1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion webhooks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,13 @@ class Webhooks {
}
};
if (q.protocol == "https:") {
logger.debug("Setting rejectUnauthorized: false");
const httpsAgent = new protocol.Agent({
rejectUnauthorized: false // (NOTE: this will disable client verification)
});
options.httpsAgent = httpsAgent;
}
logger.debug("Using request options:", options);
try {
const req = protocol.request(options, (response) => {
logger.debug("statusCode: "+ response.statusCode + " for webhook_endpoint: " + endpoint);
Expand All @@ -473,7 +475,7 @@ class Webhooks {
// logger.debug("end")
}
catch(err) {
logger.error("an error occurred while posting this json " + JSON.stringify(json), err)
logger.error("An error occurred while posting this json " + JSON.stringify(json), err)
return callback(err, null)
}
}
Expand Down

0 comments on commit 08d8a1b

Please sign in to comment.