问题描述
我在尝试使用 node-soap 发出soap 请求时遇到问题.错误仅在 ubuntu 上,我也在 windows 上测试过 - 代码(显然不包括 curl)在那里工作.
I'm running into an issue trying to make a soap request using node-soap.The error is only on ubuntu, I've tested on windows too - the code (obviously excluding curl) is working there.
我得到的错误是:
未处理的拒绝错误:写入 EPROTO 140332284700480:错误:14082174:SSL 例程:ssl3_check_cert_and_algorithm:dh 密钥太小:../deps/openssl/openssl/ssl/s3_clnt.c:36
我也尝试过使用 request/request
也失败了.使用普通 curl 时,我会收到来自我尝试连接的服务器的响应.
I've also tried using request/request
which also fails. When using plain curl I get a response from the server I'm trying to connect to.
这是我正在使用的代码:
Here's the code I'm using:
exec('curl ' + url, function(err, res) {
log(err); // null
log(res); // expected response
});
request.postAsync({
url,
rejectUnauthorized: false,
requestCert: true,
}).then(val => {
log(val);
}).catch(err => {
log(err); // above error message
})
soap.createClientAsync(url).then(val => {
log(val);
}).catch(err => {
log(err); // above error message
})
我已经在以下版本上进行了测试:
I've tested on the following versions:
节点 4.4.0 和 5.8.0,ubuntu 服务器版本 14.04 和 ubuntu 15.04 桌面版
node 4.4.0 and 5.8.0,ubuntu server version 14.04 and ubuntu 15.04 desktop
openssl 版本是 OpenSSL 1.0.2f 2016 年 1 月 28 日
The openssl version is OpenSSL 1.0.2f 28 Jan 2016
有人可以帮我吗?有没有可能以某种方式使这项工作?
Can someone help me? Is it possible to make this work somehow?
推荐答案
很可能服务器在 TLS 握手期间尝试使用安全性较低的 Diffie-Hellman 密钥.唯一的解决办法是让服务器管理员升级/修复他们的软件.
Most likely the server is trying to use less secure Diffie-Hellman keys during the TLS handshake. The only fix is for the server administrators to upgrade/fix their software.
这篇关于node.js openssl 错误:dh 键太小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!