0

First of all, I'd like to make it clear this is my very first time dealing with certificates/keys/pfx/etc.. so please correct me if I'm wrong :)

I'm using node-soap to create a client to a web-server and consume its' WSDL. Doing so only on HTTP protocol and not HTTPS i had success and everything worked just fine, but now with the pfx I get the mac verify failure error.

the relevant code:

import * as soap from 'soap';
import * as fs from 'fs';

let client_options: {
    forceSoap12Headers: true,
    wsdl_options:{
      pfx: fs.readFileSync('PATH\TO\MY\PFX')
    }
};

soap.createClient('HTTPS\WEB-SERVER\URL?wsdl', client_options, (error, client)=>{
    console.log(error.message) // <-- mac verify failure
    console.log(client) // <-- undefined
});

Worth noting:

  • I could not find any documentation of the node-soap library for the -- wsdl_options property, the pfx one i accidently found while googling so i dont know any other options available.

  • Trying to deal with this error, i found that an option of passphrase: 'password' should be added to options BUT for options of createServer with the https library, not for creating a client with node-soap.. relevant links: stackoverflow question , git issue

I've been dealing with this for the past 3 days, got to debugging all node-soap, https, and request libraries.. got lost in there.

Any help or suggestions would be much appreciated, thanks in advance!

Community
  • 1
  • 1
Kesem David
  • 2,135
  • 3
  • 27
  • 46

1 Answers1

0

did you see this link in github? https://github.com/nodejs/node-v0.x-archive/issues/7407 it also says set passphrase: 'password' in this case

farhadamjady
  • 982
  • 6
  • 14
  • I had a issue with node-soap that its never be setteled finaly I was forced to use XMLHttpRequest package of nodejs and set my sop client manualy with xml code then the problem resolved I refer you to use this package if your problem does not resolve – farhadamjady Nov 29 '16 at 05:22
  • Thank you for your answer, the linked issue already exists in my question as -git issue- and it does not refer to dealing with the error in `node-soap`. Maybe you could extend your answer to provide the use of XMLHttpRequets to create a custom client with the pfx, would be much appreciated – Kesem David Nov 29 '16 at 10:15