错误:在节点 js 中建立安全 TLS 连接之前,客户端网络套接字已断开连接

问题描述 投票:0回答:1

我遇到了这个错误 错误:在建立安全 TLS 连接之前,客户端网络套接字已断开连接 谁能解决这个问题


`var options = {
    'method': 'GET',
    'url': 'https://api-pesonetmbs.pchc.com.ph/api/v2/heartbeat',
    'headers': {
        'api-key': apikey,
        'signature': signature,
        'Content-Type': 'application/json'
    },
    'requestCert': true, 
    'rejectUnauthorized': true,
    'key': fs.readFileSync('/etc/apache2/Certs/key.pem'), 
    'cert': fs.readFileSync('/etc/apache2/Certs/ServerCert.pem'), 
    'ca': fs.readFileSync('/etc/apache2/Certs/caServerCert.pem'), 
    'passphrase': 'pQWaI6057vd1',
    'timeout': 30000
    };
    request(options, function (error, response) {
 console.log(response);
    if (error) {
        console.log("No Response from PCHC.")
        res.send('No Response from PCHC')`your text`
   
       
    }else{
        console.log("PCHC response - " + JSON.stringify(response.body));
        res.send(response.body).status(response.statusCode);
       
      
    }
   });`

node.js ssl tls1.2
1个回答
0
投票

您的方法无法连接到指定的端点 - 可能是由于代理或防火墙设置造成的

© www.soinside.com 2019 - 2024. All rights reserved.