小编inf*_*ffy的帖子

节点肥皂“UNABLE_TO_VERIFY_LEAF_SIGNATURE”错误

我试图通过 SSL 和 node-soap 模块访问 WSDL 方法。我可以连接到服务器并获取client.desclibe(),但是当我尝试访问 WSDL 上的方法时,我得到:

authorized: false,
authorizationError: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
Run Code Online (Sandbox Code Playgroud)

我试图禁用 SSL 验证或使用ssl-root-cas模块,但它没有任何意义,每次我收到此错误。

这就是我使用的方式node-soap

client = soap.createClient(wsdl_url, {
        wsdl_options: {
                key: fs.readFileSync('ssl/privatekey.key'),
                cert: fs.readFileSync('ssl/public-certificate.crt'),
                passphrase: 'password',
                rejectUnauthorized: false,
            },
        forceSoap12Headers: true
    },
    function(err, client){

        client.setSecurity(new soap.ClientSSLSecurity(
                'ssl/privatekey.key' , 
                'ssl/public-certificate.crt' , 
                'ssl/new-ca.crt' ,
                {
                    rejectUnauthorized: false,
                    passphrase: 'password'
                }

    ));

    client.ServerMethod({ name : 'value' }, function(err, result) {
          console.log(result);
    });
})
Run Code Online (Sandbox Code Playgroud)

任何人都有建议出了什么问题?我需要启用 SSL,所以我不能直接关闭它。

ssl soap wsdl web-services node.js

3
推荐指数
1
解决办法
1173
查看次数

标签 统计

node.js ×1

soap ×1

ssl ×1

web-services ×1

wsdl ×1