I'm using self-signed test certificates in my apache2 server and when I call request I get the following error:
Error: DEPTH_ZERO_SELF_SIGNED_CERT
I'm using the following code below to test it. Notice that I'm also using needle and it works with the rejectUnauthorized=true option. I could not find an equivalent on request (I've tried strictSSL=false but I guess that's the default). I couldn't find any other samples related do the problem either.
var request = require('request'),
needle = require('needle');
request('https://127.0.0.1', function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log("REQUEST:"+body);
} else {
console.error("REQUEST: "+error)
}
});
needle.get('https://127.0.0.1',{rejectUnauthorized:false},function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log("NEEDLE:"+body);
}
});
I'm using self-signed test certificates in my apache2 server and when I call request I get the following error:
I'm using the following code below to test it. Notice that I'm also using needle and it works with the rejectUnauthorized=true option. I could not find an equivalent on request (I've tried strictSSL=false but I guess that's the default). I couldn't find any other samples related do the problem either.