Hi
So my code goes like this:
var url = 'https://test.wsdl';
var auth = "Basic " + new Buffer("test" + ":" + "test").toString("base64");
var token = wsse({ username: 'test', password: 'test' });
soap.createClient( url, {wsdl_options: {
cert: fs.readFileSync('cert/test.pem'),
key: fs.readFileSync('cert/test.key'),
strictSSL: false,
rejectUnauthorized: false,
secureOptions : require('constants').SSL_OP_NO_TLSv1_2
}, endpoint : 'https://test.com'}, function(err, client) {
if(err) {throw err;}
/* client.setSecurity(new soap.ClientSSLSecurity(
'cert/test.key'
, 'cert/test.pem'
, {
strictSSL: false,
rejectUnauthorized: false,
secureOptions : require('constants').SSL_OP_NO_TLSv1_2
}
));
*/
console.log(client.describe() );
client.admGetSubscriber({input: {msisdn: 123213}}, {wsdl_headers: {
Username: 'test',
Password: token.getPasswordDigest()
}}, function(err, result){
if (err) throw err;
//throw err;
});
});
When I use soap.createClient(), in callbackI can see that wdsl is recived from url, so to this point SSL works (no need for usernameToken auth). Then when I try to use client and call some function I must define again SSL certificate,
client.setSecurity(new soap.ClientSSLSecurity()) otherwise I will get SSL error (again?). In post I must also define usernameToken auth otherwise server will reject request. The issue is that I can not define client.setSecurity two times as only the last will be used.
tnx for all help!
miha