我需要调用由HTTPS(SSL)提供服务的3d方(官方公共实体)运行的SOAP Web服务。我已经提交了CSR,并从中收到了3个证书:域证书,颁发CA证书和根CA证书。现在,我可以执行以下操作:
但是,当我尝试使用'soap'从Node.js应用程序调用Web服务时,我收到了'self_signed_cert_in_chain'错误。代码如下:
var soap = require('soap');
var fs = require('fs');
var url = <the URL>;
<file names specified>
var myKey = fs.readFileSync(keyFileName);
var myCert = fs.readFileSync(certFileName);
var issuingCACert = fs.readFileSync(issuingCAFileName);
var rootCACert = fs.readFileSync(rootCAFileName);
var bundleCACert = fs.readFileSync(bundleCAFileName);
process.env.NODE_EXTRA_CA_CERTS = "<bundled certificate file>";
console.log(process.env);
soap.createClient(urlPropertiesSearch, {
//pfx: pfxSet,
key: myKey,
cert: myCert,
ca: [issuingCACert, rootCACert],
//ca: bundleCACert,
//passphrase: password,
strictSSL: true,
},
function(err, client) {
if(err) {
console.log('client creation error: ', err);
}
else {
}
});
您可能会看到,我尝试分别指定颁发CA和根CA证书并将它们合并到一个捆绑包中,还尝试设置NODE_EXTRA_CA_CERTS环境变量。但是,错误仍然存在。