Friday, 31 August 2018

Node.js 10 HTTPS server is rejecting connections

I have simple Node.js HTTPS server

const https = require('https');
const fs = require('fs');

const config = {
  key: fs.readFileSync('cert/server-key.pem'),
  cert: fs.readFileSync('cert/server-crt.pem'),
  ca: fs.readFileSync('cert/ca-crt.pem'),
};

const server = https.createServer(config, ((req, res) => {
  console.log('Got request');

  res.end();
}));

server.listen(3333);

I use curl on embedded system.

# curl -V
curl 7.52.1 (arm-unknown-linux-gnu) libcurl/7.52.1 wolfSSL/3.9.8
Protocols: file ftp ftps http https smtp smtps telnet tftp 
Features: IPv6 Largefile SSL UnixSockets  

When I use Node.js other then version 10 - everything works nicely.

HTTPS server running on Node.js v8.2.1

# curl -k -v "https://10.43.11.128:3333/"
*   Trying 10.43.11.128...
* TCP_NODELAY set
* Connected to 10.43.11.128 (10.43.11.128) port 3333 (#0)
* SSL connected
> GET / HTTP/1.1
> Host: 10.43.11.128:3333
> User-Agent: curl/7.52.1
> Accept: */*

HTTPS server running on Node.js v10.1.0

# curl -k -v "https://10.43.11.128:3333/"
*   Trying 10.43.11.128...
* TCP_NODELAY set
* Connected to 10.43.11.128 (10.43.11.128) port 3333 (#0)
* SSL_connect failed with error -313: revcd alert fatal error
* Curl_http_done: called premature == 1
* Closing connection 0
curl: (35) SSL_connect failed with error -313: revcd alert fatal error

What has changed in Node.js 10 with regards to HTTPS? I suspect I'll have to change SSL settings but I am to sure how.



from Node.js 10 HTTPS server is rejecting connections

No comments:

Post a Comment