Answer the question
In order to leave comments, you need to log in
How to correctly use a certificate for a websocket connection?
I use a certificate from Letsencrypt for the domain. The certificate is in '/etc/letsencrypt/live/mysite/privkey.pem'.
The certificate itself is updated and everything is fine.
But in addition to the site itself, I also have a nodejs service running with a websocket. To make the connection to the websocket also secure, I copied the site certificates to the folder with the service.
const key = fs.readFileSync('ssl-cert/privkey.pem', 'utf8');
const cert = fs.readFileSync('ssl-cert/fullchain.pem', 'utf8');
const server = require('https').createServer({key, cert}, app);
Answer the question
In order to leave comments, you need to log in
You can proxy through nginx and, for example. use cloud and infinite ssl
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question