SSL Error in nodejs

后端 未结 3 935
一整个雨季
一整个雨季 2020-12-14 12:36

I\'m trying to get a webpage via node https.request(). Doing so results in an error getting logged by my code. Using the node request module has the same result:

相关标签:
3条回答
  • 2020-12-14 12:53

    We hit the same problem. By default, request uses the https.globalAgent. So we added the code near the top of our script.

    var https = require('https');
    https.globalAgent.options.secureProtocol = 'SSLv3_method';
    

    All of a sudden everything worked.

    0 讨论(0)
  • 2020-12-14 12:57

    In case website uses ECDH curve, for me the issue resolved only by adding this option:

    request({ url, agentOptions: {
                ecdhCurve: 'P-521:P-384:P-256',
    },(err,res,body) => {
    

    JFYI, May be this will help someone.

    0 讨论(0)
  • 2020-12-14 13:05

    Try to use options = { secureProtocol: 'SSLv3_method' } in the request you are making.

    0 讨论(0)
提交回复
热议问题