【问题标题】:socket hang up at TLSSocket.onHangUp when connecting to IIS6 server with TLS 1.0使用 TLS 1.0 连接到 IIS6 服务器时,套接字在 TLSSocket.onHangUp 处挂起
【发布时间】: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


    【解决方案1】:

    原来它的 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-10
      • 2014-04-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-19
      相关资源
      最近更新 更多