I wanted to change from http to https in nodeJS. My .pem files come from Let's Encrypt and are actually properly embedded. The client gets a 500 status code. The console issues a "listen EACCES 0.0.0.0:443" unhandled error.
My http server worked on port 443, so I don't understand why this shouldn't work anymore. On other ports I get the error that this port is already occupied, although this is not the case. At first I thought it was the .pem files, but they are correctly linked and otherwise there would be a tendency to error, right?
//require https/ fs
const options = {
key: fs.readFileSync('conf/DEV-KEY.pem'),
cert: fs.readFileSync('conf/DEV-CERT.pem')
};
https.createServer(options, (req, res) => {
res.writeHead(200);
res.end("Hello World");
}).listen(443);
Client message: jquery.min.js:4 POST https://h2825492.stratoserver.net/register 500 enter image description here Server message: events.js:165 throw er; // Unhandled 'error' event ^ Error: listen EACCES 0.0.0.0:443
This question is not a duplicate, because Port 443 runs with my http Server - I don't know, why the Port should not work on https!?