通过节点js连接到SOAP端点在ssl上时出错

时间:2017-11-15 12:58:14

标签: javascript node.js ssl soap

我是节点js和javascript的新手,所以在我的初始程序中,我试图通过SSL连接到SOAP端点,但它在下面的部分中一直失败并提示错误。

我尝试了多个选项并最终得到了以下代码,但仍然无法弄清楚我做错了什么。

看看并告诉我它出了什么问题。

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: write EPROTO 101057795:error:140773F2:SSL 
routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected 
message:openssl\ssl\s23_clnt.c:769

0 个答案:

没有答案