C
C
codeZlo2019-05-09 22:17:15
Node.js
codeZlo, 2019-05-09 22:17:15

How to properly install SSL certificate with Node.js script (Socket.io) without express?

Installed free SSL from reg.ru on a node.js script as follows (back):

var https = require('https')
var options = {
    key:    fs.readFileSync('1.pem').toString(),
    cert:   fs.readFileSync('2.pem').toString(),
    ca : fs.readFileSync('4.csr').toString() 
}
var app = https.createServer(options)
var io = require('socket.io').listen(app) 
app.listen(config.port || 8083)

front:
var socketIO = io('https://domain.com:8080' || 'https://domain.com:8083', {secure: true})
socketIO.once('connect', function(){
})

Mac OS in Chrome, everything works fine, it connects. On Windows in Chrome and in other browsers, there is an endless error:
net:: ERR_CONNECTION_TIMED_OUT
Guys, help, please, the whole brain has broken. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
codeZlo, 2019-05-10
@codeZlo

Issue resolved. The problem was in CloudFlare. Only certain ports work on the https protocol.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question