带有证书的node-soap createClient

时间:2016-01-29 16:39:01

标签: node.js web-services ssl soap node-soap

我正在尝试使用node-soap

通过https获取WSDL文件

这是我的尝试:

ldap.getEmpowerments = function(uid) {
    return new Promise(function(resolve, reject) {

        var url = 'https://yradeowshabil.corp.leroymerlin.com/adeo-ws-habil/AccessManagementService?WSDL'

        createClient(url).then( function(client) {

            console.log(client.describe);

        }, function(error) {
            console.error('habilitation client failed', error);
        });
    });
};

那给了我输出:

> hablitation client failed 
> [Error: 140274398734112:error:140773F2:SSL
> routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected
> message:../deps/openssl/openssl/ssl/s23_clnt.c:770: ]

我有两个必需的证书,以便与wsdl文件建立通信。
我尝试了setSecurity方法,但我的客户端从未创建,所以它没用。

根据文档,我可以在createClient方法中添加一些选项,并覆盖请求对象或httpClient。事情是没有解释如何做到这一点。我该怎么办?set up the my custom request with ssl

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

请尝试将此添加到您的app.js:

process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';
相关问题