There is a server Node.js + Express

var app = require('express')(); var fs = require('fs'); var options = { key: fs.readFileSync('private.key.pem'), cert: fs.readFileSync('cert.crt.pem') }; var https = require('https').Server(app); var io = require('socket.io')(https); https.listen(3000, function() { console.log('Server started on port 3000'); }); io.on('connection', function(socket){ console.log('Connected....'); }); 

When connecting via Https, it gives an error: SSL_ERROR_NO_CYPHER_OVERLAP (This is Firefox)
Like and indicated certificates in the .pem format
Still not working
Apache server
I am connected on the domain through the 3000th port

  • I hope you do this only for tests. You do not need to do an offsod ssl in the production on the side of the node, please. - Suvitruf
  • Is it not advisable to use a node as a server? Can be more? And how best to implement it correctly? I just started learning the node a couple of days. - witetigre
  • one
    The node is possible, but the offspring ssl needs to be done on the side of nginx, and in the node, proxy the decrypted data. - Suvitruf

1 answer 1

Was not attentive. Did not pass options to .Server (app); It was .Server (app);
Need .createServer (options, app)

And more, can someone help. Be sure to convert your keys to .pem format.