SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/s23_clnt.c:772:
- Node.js Version: 6.x.x, 8.x.x, 10.x.x
- OS: Cenots 7 / macOS Mojave
- Scope (install, code, runtime, meta, other?): Runtime
- Module (and version) (if relevant): request, https, expressjs
So, I've been surfing through all the online resources to find a fix for this, but I am out of options. Any hand would be much appreciated.
We are currently trying to do a call to one of our clients servers(a tomcat machine) and our node simply won't do it.
curl/wget/openssl, Python, PHP, Golang - are all working and we can successfully do the GET call, just node won't do it.
There is a simple script that is trying to access the https resource on port 9080 and bellow is the error we get.
const request = require('request');
var options = {
url: "https://some.url.com:9080/jazz/oauth-authorize",
strictSSL: false,
secureProtocol: 'TLSv1_2_method',
ecdhCurve: 'secp384r1'
};
request(options, (err, res, body) => {
if (err) { return console.log(err); }
console.log(body.url);
console.log(body.explanation);
});
ERROR: *** Error: write EPROTO 140394737522496:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:1494:SSL alert number 40 ***
I had this same problem today and it turned out to be a too-old version of node. Upgraded to latest stable version and problem went away.
@ngspinu hello. I've got the same problem. Did you solve it?? Could you help me?
Hi, I have managed to fix it. However it looked like a very isolated case. I am using PasspotJs Oauth1 package, and the API(the jazz one) was using APache Tomcat webserver. For whatever reason - the last version of PasspotOauth1 - would not cope with my client's Tomcat.
I fixed this by adding an older version of the PasspotOauth1.
I bumped into this using the request library running on AWS lambda node 8.10. It was fixed by moving to 10.x.
issue resolved, closing. thanks!
@tnolet Thank you very much for posting very critical update important info.... Good JOB..
Does anyone know what release of Node fixes this SSL bug? I'm currently unable to fetch pages from https://nitter.net using node v8.15.1. v10.18.1 works.
$ node -e "require('https').get('https://nitter.net', (e,r,b) => {console.log(e);});" events.js:183
throw er; // Unhandled 'error' event
^
Error: write EPROTO 140122876737344:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/s23_clnt.c:802:
at WriteWrap.afterWrite [as oncomplete] (net.js:868:14)
https://github.com/nodejs/node/issues/21513 includes a workaround which helps my case:
require("tls").DEFAULT_ECDH_CURVE = "auto"
The old discussion is present in thisthread. Basically, its not going to change in Node 8. What the right option is to address/resolve will concern whether you are running on the client or the server side of this, but for most situations the client-side workaround to set the default ECDH curve to "auto" is probably the most generally applicable.
Alternatively, and with Node 8 now out-of-support, better still is to move to a later LTS release.