NODE JS-建立安全TLS连接之前,客户端网络套接字已断开连接

时间:2020-04-24 06:36:10

标签: node.js amazon-web-services paypal cloud tls1.2

我在运行使用SDK生成PayPal发票的节点脚本时遇到错误,当它在本地服务器上运行时运行正常,但是在生产服务器上运行时却出现以下错误:

Uncaught Exception  
{
    "errorType": "Error",
    "errorMessage": "Client network socket disconnected before secure TLS connection was established",
    "code": "ECONNRESET",
    "path": null,
    "host": "api.paypal.com",
    "port": 443,
    "stack": [
        "Error: Client network socket disconnected before secure TLS connection was established",
        "    at TLSSocket.onConnectEnd (_tls_wrap.js:1095:19)",
        "    at Object.onceWrapper (events.js:286:20)",
        "    at TLSSocket.emit (events.js:203:15)",
        "    at TLSSocket.EventEmitter.emit (domain.js:448:20)",
        "    at endReadableNT (_stream_readable.js:1145:12)",
        "    at process._tickCallback (internal/process/next_tick.js:63:19)"
    ]
}

版本详细信息:

Node Js 10.x,TLS:1.0

有人遇到这样的错误吗?

1 个答案:

答案 0 :(得分:3)

"host": "api.paypal.com",

TLS:1.0


PayPal需要TLS 1.2 https://developer.paypal.com/docs/api/info-security-guidelines/#usetls12

如果这是您输入的问题,而您实际上正在使用1.2,则必须对其进行更深入的调试。