0

I'm using node v0.10.32. I wanted to create a SOAP request in node.js. I encountered this error: "request Hostname/IP doesn't match certificate's altnames "

As suggested in this link

Node.js Hostname/IP doesn't match certificate's altnames

I should put in {rejectUnauthorized: false}. But it still throws me the same error. (BTW: What does "altname" actually mean?)

My Code looks like this:

var soap = require('soap');
var url = 'https://link.to/my/url/file.wsdl';
var args = {Email: 'my@email.de', Passwort: 'passwort123', deviceMac: '00-14-22-01-23-45'};
soap.createClient(url, {rejectUnauthorized: false}, function(err, client) {
  client.myOperation(args, function(err, result) {
      console.log(err, result);
  });
});

I also tried this (I got the same error message)

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
var soap = require('soap');
var url = 'https://link.to/my/url/file.wsdl';
var args = {Email: 'my@email.de', Passwort: 'passwort123', deviceMac: '00-14-22-01-23-45'};
soap.createClient(url, function(err, client) {
    client.myOperation(args, function(err, result) {
        console.log(err, result);
    });
});

Could it be that the url doesn't start with "https://www."?

Community
  • 1
  • 1
thadeuszlay
  • 2,787
  • 7
  • 32
  • 67
  • I know this is an aged question, but I'm having the exact same issue with the same package. Can you please elaborate as to how you solved this issue? Did you just change https to http as suggested in the accepted answer? Also, where did you make that change? – blueren Aug 22 '17 at 13:22

1 Answers1

1

The 'soap' library you're using probably depends on the node 'request' library which means it's the same issue as: Node.js Hostname/IP doesn't match certificate's altnames

Your easiest solution would be to make your request over http instead of https (change https to http in your url).

Community
  • 1
  • 1
encrest
  • 1,757
  • 1
  • 17
  • 18