title: process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0 not working
body: <p>I'm using the node sendmail package which is giving me this error:</p>
  <pre><code>Error on connectMx for:  Error: self signed certificate
       at TLSSocket.onConnectSecure (_tls_wrap.js:1515:34)
       at TLSSocket.emit (events.js:400:28)
       at TLSSocket._finishInit (_tls_wrap.js:937:8)
       at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:709:12) {
     code: 'DEPTH_ZERO_SELF_SIGNED_CERT'
  }
  </code></pre>
  <p>So I put this in my code in like 5 places</p>
  <pre><code>process.env[&quot;NODE_TLS_REJECT_UNAUTHORIZED&quot;] = 0;
  </code></pre>
  <p>Node says this warning when I run it:</p>
  <pre><code>Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
  </code></pre>
  <p>Yet I still get the error message.  It's coming from this code:</p>
  <pre><code>const {createConnection} = require('net');
  createConnection(smtpPort, data[i].exchange);  // problem code
  sock.on('error', function (err) {
      logger.error('Error on connectMx for: ', data[i], err);
      tryConnect(++i)
  });
  </code></pre>
  <p>Is this a bug in NodeJS, or am I messing something up?  Thanks for the help.</p>