0

I am newbee to node js and javascript, So in my initial program i am trying to connect to a SOAP end point over SSL, but it is continuously failing with error mentione in the section below.

I tried multiple option and ended up with below code but still can't figure out what am i doing wrong.

have a look and suggest me what is going wrong in it.

var soap = require('soap');
var https = require('https');
var url = "https://test:12345/soap/call/wrapper-01";
var auth = "Basic " + new Buffer("eaiadmin" + ":" + 
"'Geheim.1").toString("base64");
var request = require('request');
var fs = require('fs');
var specialRequest = request.defaults({
agentOptions: {
  ca: fs.readFileSync('Cert.cer') //path of CA cert file
  }
 }); 



var args = {};

soap.createClient(url, {
    wsdl_headers: {Authorization: auth},
    headers:{ "Accept": "text/xml",
            "Content-length": "soapXML.length",
            "Content-Type": "text/xml;charset=UTF-8",
            "SOAPAction": "/CustomerOrderWrapper-001/CompleteOrderCapture ",
            "Accept-Encoding": "gzip,deflate",
            "Content-Type": "application/soap+xml;charset=UTF-
 8;action='url'",
            "Content-Length": "2053",
            "Host": "localhost:44300",
            "Connection": "Keep-Alive",
            "User-Agent": "Apache-HttpClient/4.1.1 (java 1.5)"
  },
    request : specialRequest
    }, function(err, client) {
    if (err) {
    console.log(err);
    } else {
    console.log('Success');
    }
    });

Error: This is the error i am getting when calling the client:

{ Error: write EPROTO 101057795:error:140773F2:SSL 
routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected 
message:openssl\ssl\s23_clnt.c:769
Newbee123
  • 1
  • 1

0 Answers0