Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node-request - Getting error "SSL23_GET_SERVER_HELLO:unknown protocol"

I'm using the node-request module, regularly sending GET requests to a set of URLs and, sometimes, getting the error below on some sites.

Error: 29472:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:683

The problem is that I don't get this error always or always on the some URLs, just sometimes. Also, it can't be ignored with "strictSSL: false".

I have read that this can be related to me sending SSL requests with the wrong protocol (SSLv2, SSLv3, TLS..). But this doesn't explain why it happens irregularly.

Btw, I'm running nodejs on a Win 2008 server.

Any help is appreciated.

like image 335
umutm Avatar asked Mar 14 '13 22:03

umutm


4 Answers

You will get such error message when you request HTTPS resource via wrong port, such as 80. So please make sure you specified right port, 443, in the Request options.

like image 151
Gaf King Avatar answered Oct 08 '22 16:10

Gaf King


This was totally my bad.

I was using standard node http.request on a part of the code which should be sending requests to only http adresses. Seems like the db had a single https address which was queried with a random interval.

Simply, I was trying to send a http request to https.

like image 39
umutm Avatar answered Oct 08 '22 17:10

umutm


I got this error because I was using require('https') where I should have been using require('http').

like image 25
Ben Avatar answered Oct 08 '22 18:10

Ben


Some of the sites are speaking SSLv2, or at least sending an SSLv2 server-hello, and your client doesn't speak, or isn't configured to speak, SSLv2. You need to make a policy decision here. SSLv2 should have vanished from the face of the earth years ago, and sites that still use it are insecure. However, if you gotta talk to them, you just have to enable it at your end, if you can. I would complain to the site owners though if you can.

like image 31
user207421 Avatar answered Oct 08 '22 16:10

user207421