Skip to content

Commit bf53329

Browse files
committed
Fix issue where rejectUnauthorized would default to false instead of true
1 parent ae38832 commit bf53329

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/XMLHttpRequest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ function XMLHttpRequest(opts) {
397397
options.cert = opts.cert;
398398
options.ca = opts.ca;
399399
options.ciphers = opts.ciphers;
400-
options.rejectUnauthorized = opts.rejectUnauthorized;
400+
options.rejectUnauthorized = opts.rejectUnauthorized === false ? false : true;
401401
}
402402

403403
// Reset error flag
@@ -442,7 +442,7 @@ function XMLHttpRequest(opts) {
442442
newOptions.cert = opts.cert;
443443
newOptions.ca = opts.ca;
444444
newOptions.ciphers = opts.ciphers;
445-
newOptions.rejectUnauthorized = opts.rejectUnauthorized;
445+
newOptions.rejectUnauthorized = opts.rejectUnauthorized === false ? false : true;
446446
}
447447

448448
// Issue the new request

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "xmlhttprequest-ssl",
33
"description": "XMLHttpRequest for Node",
4-
"version": "1.6.0",
4+
"version": "1.6.1",
55
"author": {
66
"name": "Michael de Wit"
77
},

0 commit comments

Comments
 (0)