0

If I do a GET in Postman it succeeds but if I try a GET in my Node.js application I get this error:

{ 
  Error: unable to verify the first certificate
  at TLSSocket.<anonymous> (_tls_wrap.js:1103:38)
  at emitNone (events.js:106:13)
  at TLSSocket.emit (events.js:208:7)
  at TLSSocket._finishInit (_tls_wrap.js:637:8)
  at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:467:38)
    message: 'unable to verify the first certificate',
    code: 'NetworkingError',
    region: 'us-east',
    hostname: '1.1.1.1',
    retryable: true,
    time: 2018-05-09T09:54:26.736Z 
}

I'm using the same endpoint and credentials.

What could be causing this?

kgangadhar
  • 4,886
  • 5
  • 36
  • 54
pac
  • 491
  • 1
  • 7
  • 30
  • Possible duplicate of [Error: unable to verify the first certificate in nodejs](https://stackoverflow.com/questions/31673587/error-unable-to-verify-the-first-certificate-in-nodejs) – Muhammad Usman May 09 '18 at 10:03

1 Answers1

1

I added NODE_TLS_REJECT_UNAUTHORIZED=0 at the start of my command.

pac
  • 491
  • 1
  • 7
  • 30