Sarfaraz Khan Sarfaraz Khan - 1 year ago 218
Node.js Question

how to ignore self signed certificate error node.js soap.js

I have created a soap client in node.js using soap.js.Soap communication is done over https. When I try to connect I keep getting this error

{ [Error: self signed certificate] code: 'DEPTH_ZERO_SELF_SIGNED_CERT'

Below is my code

var url = '../public/test.wsdl';

var client = soap.createClient(url,sslOptions, function(err, client) {
client.setSecurity(new soap.WSSecurity('testuser', 'testpassword'));
client.CheckStatus(args, function(err, result) {
// console.log(result);


I've also tried the following ssl setting but did't work out

sslOptions = {
key: fs.readFileSync( '../certs/test-key.pem'),
cert: fs.readFileSync( '../certs/test-cert.pem'),
rejectUnauthorized : false,
secureOptions : constants.SSL_OP_NO_TLSv1_2,
strictSSL : false

Any help would be appreciated !!

Answer Source

Found it yesterday on their github repo

@tesfel tesfel commented on 17 Feb

Add the cert to your trusted list at you computer or add


to your code.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download