I'm not really sure if this is a problem with MacOS Catalina, OpenSSL or Node, but I recently discovered that I can't request certain URLs using node.js.
This is the code which triggers the error:
request({
method: 'GET',
uri: 'sample url goes here',
json: true,
auth: {
user: 'some username',
pass: 'some password',
sendImmediately: false
}
}, (error, response, body) => // ...
When using request
on node version 8.11.3, this is the error I get:
request: { Error: write EPROTO 4483825088:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827:
at _errnoException (util.js:992:11) at WriteWrap.afterWrite [as oncomplete] (net.js:864:14) code: 'EPROTO', errno: 'EPROTO', syscall: 'write' } }
The error is slightly different when using node 10.15.3:
{ Error: write EPROTO 4545691072:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:252:
at WriteWrap.afterWrite [as oncomplete] (net.js:779:14) errno: 'EPROTO', code: 'EPROTO', syscall: 'write' } }
So in the first call the error seems to be unknown protocol and wrong version number in the second.
I've googled around but the error seems pretty generic and not specifically related to node.js, but I'm not getting this error when using CURL. I am however, getting an SSL error when I'm using Insomnia (a REST client which I think uses node in the background). The logs in Insomnia give me this:
* ALPN, offering http/1.1
* WARNING: disabling hostname validation also disables SNI.
* Server aborted the SSL handshake
* Closing connection 10
I'm guessing this could have to do with Catalina since I recently upgraded. I also updated brew packages after upgrading, so that could also be the problem.
What I've tried so far is to default to OpenSSL from Homebrew (export PATH="/usr/local/opt/openssl/bin:$PATH"
) because I read that Catalina was using libressl and I figured that might've been the problem. That didn't change anything though.
Does anyone have a clue?