Deploying with custom secret PEM files

I have a local NodeJS app that’s served with HTTPS and local PEM files generated by mkcert.
Something like this:

let options = {
  key: fs.readFileSync('./localhost-key.pem'),
  cert: fs.readFileSync('./localhost.pem')
};

let server = https.createServer(options, app);
let port = process.env.PORT || 3000;
server.listen(port, () => {
  console.log(`Server listening on port=${port}`);
});

I’ve tried adding the PEM files to the “Secret Files” section with the above filenames but when I start my server I get 502 EOF for all requests (I do get the “server listening” log).

I know that Render has managed TLS so I wonder if it’s just my configuration or I needn’t use PEM files when deploying to Render at all?

Hi,

When deploying to Render your web server only needs to respond to HTTP calls (not HTTPS). TLS is terminated before requests get into the Render network and then our proxy only makes HTTP requests to your instance.

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.