diff options
author | cjihrig <cjihrig@gmail.com> | 2018-07-19 22:02:44 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2018-07-22 21:49:40 -0400 |
commit | 3095eecc4748da4ce7ac70e2b352ddba6c4c4deb (patch) | |
tree | bf1783e34a98af692b99279ca6fd2be6da3f269d /test | |
parent | 87f767160d103114eff154e98bde69caa178c59f (diff) | |
download | android-node-v8-3095eecc4748da4ce7ac70e2b352ddba6c4c4deb.tar.gz android-node-v8-3095eecc4748da4ce7ac70e2b352ddba6c4c4deb.tar.bz2 android-node-v8-3095eecc4748da4ce7ac70e2b352ddba6c4c4deb.zip |
tls: warn on NODE_TLS_REJECT_UNAUTHORIZED = '0'
Warn on the first request that sets the
NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0'.
PR-URL: https://github.com/nodejs/node/pull/21900
Refs: https://github.com/nodejs/node/issues/21774
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-https-strict.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-https-strict.js b/test/parallel/test-https-strict.js index f575f52406..0e8f725a5d 100644 --- a/test/parallel/test-https-strict.js +++ b/test/parallel/test-https-strict.js @@ -28,6 +28,14 @@ if (!common.hasCrypto) // disable strict server certificate validation by the client process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; +common.expectWarning( + 'Warning', + 'Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to \'0\' ' + + 'makes TLS connections and HTTPS requests insecure by disabling ' + + 'certificate verification.', + common.noWarnCode +); + const assert = require('assert'); const https = require('https'); |