title: stack "Error: self signed certificate in certificate chain" when trying to build 'node-gyp configure'
body: <p>I got below error when trying to build the microsoft driver for nodejs for sql server </p>
  
  <blockquote>
    <p>gyp info it worked if it ends with ok</p>
    
    <p>gyp info using node-gyp@3.2.1</p>
    
    <p>gyp info using node@5.3.0 | win32 | x64</p>
    
    <p>gyp http GET
    <a href="https://nodejs.org/download/release/v5.3.0/node-v5.3.0-headers.tar.gz" rel="noreferrer">https://nodejs.org/download/release/v5.3.0/node-v5.3.0-headers.tar.gz</a></p>
    
    <p>gyp WARN install got an error, rolling back install</p>
    
    <p>gyp ERR! configure error</p>
    
    <p>gyp ERR! stack <strong>Error: self signed certificate in certificate chain</strong></p>
    
    <p>gyp ERR! stack     at Error (native)</p>
    
    <p>gyp ERR! stack     at TLSSocket. (_tls_wrap.js:1057:38)</p>
    
    <p>gyp ERR! stack     at emitNone (events.js:67:13)</p>
    
    <p>gyp ERR! stack     at TLSSocket.emit (events.js:166:7)</p>
    
    <p>gyp ERR! stack     at TLSSocket._fini<code>enter code here</code>shInit </p>
    
    <p>gyp ERR! not ok "</p>
  </blockquote>
  
  <p>i tried with below workaround but it dint work</p>
  
  <pre><code>1) upgrade your version of npm
  
  npm install npm -g --ca=null
  
  - or -
  
  2) tell your current version of npm to use known registrars  
  
  npm config set ca=""
  </code></pre>
  
  <p>Can anyone guide me how to resolve this certificate issue</p>