title: Nodejs https request UNABLE_TO_GET_ISSUER_CERT_LOCALLY
body: <p>OS: debian sid</p>
  
  <p>Nodejs: v0.10.38</p>
  
  <p>I have a request to a private service that use authentication:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var https = require('https');
  
  var options = {
      host: 'private.service.com',
      path: '/accounts/' + '123323' + '/orders',
      method: 'POST',
      headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
          'Content-Length': 0,
          'Authorization': 'Bearer ' + 'asdsdgcvxcvxcv'
      }
  };
  
  var request = https.request(options, function (res) {
      console.log(res);
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>When i run the script, node throws this error:</p>
  
  <pre><code>events.js:72
      throw er; // Unhandled 'error' event
            ^
  Error: UNABLE_TO_GET_ISSUER_CERT_LOCALLY
      at SecurePair.&lt;anonymous&gt; (tls.js:1381:32)
      at SecurePair.emit (events.js:92:17)
      at SecurePair.maybeInitFinished (tls.js:980:10)
      at CleartextStream.read [as _read] (tls.js:472:13)
      at CleartextStream.Readable.read (_stream_readable.js:341:10)
      at EncryptedStream.write [as _write] (tls.js:369:25)
      at doWrite (_stream_writable.js:226:10)
      at writeOrBuffer (_stream_writable.js:216:5)
      at EncryptedStream.Writable.write (_stream_writable.js:183:11)
      at write (_stream_readable.js:602:24)
  </code></pre>
  
  <p>The same exact script worked well for months, and i'm sure the authentication is correct. Today is the first time i have this situation.</p>
  
  <p><strong>Which can be the cause for this error?</strong></p>