J
J
jtag2019-03-08 19:33:01
Node.js
jtag, 2019-03-08 19:33:01

Why can't https server see incoming requests?

Unable to start https server, native htttps module is used, certificates are purchased. Through the wireshark, you can see that a request is coming. But the node does not seem to see it. If I run it as http, then all requests are normally displayed and responses go away.

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

const options = {
  key: fs.readFileSync('key.pem'),
  cert: fs.readFileSync('cert.pem')
};

https.createServer(options, (req, res) => {
        console.log("request");
  res.writeHead(200);
  res.end('hello world\n');
}).listen(8443);

tshark: 185.146.1.121 → 172.16.0.50 TCP 66 [TCP Retransmission] 51363 → 8443 [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question