Skip to content

Instantly share code, notes, and snippets.

@thilander
Forked from treo/test.js
Created January 11, 2018 13:37
Show Gist options
  • Save thilander/8ebb20baed55bf49058e17b84f39794b to your computer and use it in GitHub Desktop.
Save thilander/8ebb20baed55bf49058e17b84f39794b to your computer and use it in GitHub Desktop.
Accessing a SOAP web service which requires a client certificate using node-soap 0.4.3
var soap = require('soap'),
fs = require('fs');
client = soap.createClient('https://some-webserv.ic/something.wsdl', {
wsdl_options: {
cert: fs.readFileSync('cert.pem'),
key: fs.readFileSync('keyfile.key')
}
}, function(err, client){
console.log(client.describe());
})
// Note: the keyfile should not be secured with a passphrase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment