Skip to content

Commit

Permalink
fix: fixed support for NODE_TLS_REJECT_UNAUTHORIZED (per #1511)
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed Dec 20, 2019
1 parent 477f3c5 commit 2377e62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/node/index.js
Expand Up @@ -747,7 +747,10 @@ Request.prototype.request = function() {
options.cert = this._cert;
options.passphrase = this._passphrase;
options.agent = this._agent;
options.rejectUnauthorized = !this._disableTLSCerts;
options.rejectUnauthorized =
typeof this._disableTLSCerts === 'boolean'
? !this._disableTLSCerts
: process.env.NODE_TLS_REJECT_UNAUTHORIZED !== '0';

// Allows request.get('https://1.2.3.4/').set('Host', 'example.com')
if (this._header.host) {
Expand Down

0 comments on commit 2377e62

Please sign in to comment.