Node -request - Getting the error "SSL23_GET_SERVER_HELLO: unknown protocol"

I use 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 do not get this error always or always at some URLs, sometimes. In addition, it cannot be ignored with " strictSSL: false ".

I read that this could be due to the fact that I am sending SSL requests with the wrong protocol (SSLv2, SSLv3, TLS ..). But this does not explain why this happens irregularly.

Btw, I am running nodejs on a Win 2008 server.

Any help is appreciated.

+69
ssl request
Mar 14 '13 at 22:02
source share
11 answers

It was very bad.

I used the standard http.request node on a piece of code that should only send requests to http addresses. It looks like db had one https address, which was requested at random intervals.

Simply, I tried to send an HTTP request to https.

+16
Apr 22 '13 at 13:23
source share

You will get this error message if you request an HTTPS resource through the wrong port, for example 80. Therefore, please make sure that you specify the correct port, 443, in the request parameters.

+105
Aug 09 '13 at 8:32 on
source share

Some of the sites speak SSLv2, or at least send an SSLv2-hello server, and your client does not speak or is not configured to use SSLv2. Here you have to make a political decision. SSLv2 was supposed to disappear from the face of the earth a few years ago, and sites that still use it are insecure. However, if you need to talk to them, you just need to include it at the end if you can. I would complain to the owners of the sites, though, if possible.

+4
Mar 14 '13 at 22:09
source share

I had this problem (403 error for each package) and I did not find anything good on the Internet to solve it. My .npmrc file inside my user folder was incorrect and misunderstood. I changed this npmrc line with

 proxy=http://XX.XX.XXX.XXX:XXX/ 

to:

 proxy = XX.XX.XXX.XXX:XXXX 
+3
Jan 17 '18 at 16:37
source share
 var https = require('https'); https.globalAgent.options.secureProtocol = 'SSLv3_method'; 
+2
Jan 10 '14 at 3:31
source share

I got this error because I used require('https') , where I had to use require('http') .

+2
Aug 19 '15 at 15:01
source share

I got this error when connecting to Amazon RDS. I checked the server status for 50% of the CPU usage while it was a development server and no one is using it.

It worked before, and nothing in the connection configuration has changed. Rebooting the server fixed the problem for me.

0
Feb 24 '17 at 14:26
source share

in my case (the SSL website uses ev curves) the SSL problem was solved by adding this option ecdhCurve: 'P-521: P-384: P-256'

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

JFYI maybe this will help someone

0
Feb 27 '19 at 18:21
source share

I got this error when I used it on my rocketchat to communicate with my gitlab through a corporate proxy,

Because I used https: //: 8080, but actually it worked for http: //: 8080

0
Aug 28 '19 at 2:01
source share

In short,

 vi ~/.proxy_info export http_proxy=<username>:<password>@<proxy>:8080 export https_proxy=<username>:<password>@<proxy>:8080 source ~/.proxy_info 

Hope this helps someone in a hurry :)

-one
Sep 05 '18 at 6:24
source share

It sounds like you just need to have some retry logic, so intermittent errors didn't hang you up.

 function faultTolerantRequest (url, trys, retryTime, cb) { var attempts = 0; function requestFinished (err, res, body) { if (err) { if (attempts < trys) { return setTimeout(tryRequest, retryTime); } return cb(err); } return cb(err, res, body); } function tryRequest () { attempts++; return request(url, requestFinished); } return tryRequest(); } 
-3
Mar 15 '13 at 19:53
source share



All Articles