【发布时间】:2017-03-02 02:20:19
【问题描述】:
这发生在 v4 - v7 的各种节点版本中,也发生在 AxiosJS 和 RequestJS 中。
典型错误信息:
{ Error: socket hang up
at TLSSocket.onHangUp
...
code: 'ECONNRESET',
【问题讨论】:
标签: node.js request iis-6 axios
这发生在 v4 - v7 的各种节点版本中,也发生在 AxiosJS 和 RequestJS 中。
典型错误信息:
{ Error: socket hang up
at TLSSocket.onHangUp
...
code: 'ECONNRESET',
【问题讨论】:
标签: node.js request iis-6 axios
原来它的 IIS6 使用(现在)过时的 ssl 协议,NodeJS 的开发人员认为它不安全被列为默认 ciphers
The connection to this site uses an obsolete protocol (TLS 1.0), andobsolete key exchange (RSA), and an obsolete cipher (3DES_EDE_CBC with HMAC-SHA1).
修复/绕过此问题
在 NodeJS 中,将ciphers: 'DES-CBC3-SHA' 添加到请求选项中。
在 Axios 中,添加下面的请求选项,
httpsAgent: new https.Agent({
ciphers: 'DES-CBC3-SHA'
})
在请求中,添加下面的请求选项,
agentOptions: {
ciphers: 'DES-CBC3-SHA'
}
查看更多信息:
https://github.com/nodejs/node/issues/10900#issuecomment-273834289
https://github.com/nodejs/node/issues/9845#issuecomment-264032107
【讨论】: