mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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>
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user