0

I am trying to get data from https endpoints using node-rest-client

const Client = require('node-rest-client').Client;

const client = new Client();

client.get("https://myapi.com/data.xml", function (data, response) {
    // parsed response body as js object
    console.log(data);
    // raw response
    console.log(response);
});

but I got this error:

Error: unable to verify the first certificate
    at TLSSocket.onConnectSecure (_tls_wrap.js:1049:34)
    at TLSSocket.emit (events.js:182:13)
    at TLSSocket._finishInit (_tls_wrap.js:631:8)
maroodb
  • 1,026
  • 2
  • 16
  • 28

0 Answers0