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:
problem with request: 140398870042432:error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message:s23_clnt.c:658:
The following indicates the wrong SSL version is being used, but I cannot find a way to change the version: curl error: "sslv3 alert unexpected message". Using curl from my terminal returns a response as does hitting the URL in my browser (it is a login page). My code is below.
var request = require('request')
request.get("https://icmserver.wit.ie/balance", function(err, res, body) {
if (err) {
return console.log(err)
}
return body;
});
Does anyone have any idea what might be happening here?
Try to use options = { secureProtocol: 'SSLv3_method' }
in the request you are making.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With