P
P
prebionix2017-06-02 20:11:58
Node.js
prebionix, 2017-06-02 20:11:58

How to install ssl certificate on a port?

There is a socket server node.js (via nohup), which hangs on port 8585. The entire site was transferred to https through a certificate from let's encrypt. Therefore, the browser refused to work with http://ip:8585web sockets.
Goal: connect to node.js server at: https://domain:8585.
Question: do I need to include an ssl certificate for this port or not (and how?)? Or is it enough to enable https processing in the Node.js script itself?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2017-06-02
@BorisKorobkov

options = {
      key: fs.readFileSync('ssl/cert.key'),
      cert: fs.readFileSync('ssl/cert.crt')
    };
    server = require('https').Server(options, express);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question