2016. augusztus 16., kedd

Node.js Error: self signed certificate - önaláírt tanúsítvány hiba

node cli1.js
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: self signed certificate
    at Error (native)
    at TLSSocket.<anonymous> (_tls_wrap.js:1017:38)
    at emitNone (events.js:67:13)
    at TLSSocket.emit (events.js:166:7)
    at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:582:8)
    at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:424:38)


Önaláírt tanúsítványok engedélyezése:

http2.globalAgent = new http2.Agent({
  // Accept self-signed certificates
  rejectUnauthorized: false
});