J Del
J Del

Reputation: 881

Cloudflare SSL handshake failed with socket.io

This is the code I'm using:

"use strict"
var express = require('express');
var https = require('https');
var app = express();
var bodyParser = require('body-parser');
app.enable('trust proxy');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
    extended: true
}));
var fs = require('fs');
var options = {
    cert: fs.readFileSync('ssl_certs/cert.pem'),
    key: fs.readFileSync('ssl_certs/privkey.pem'),
    requestCert: true,
};
var server = https.createServer(options, app);
var io = require('socket.io')(server);
var port = 2083
server.listen(port, "0.0.0.0", function() {
    console.log('Listening on port *:' + port + '.');
});

io.on('connection', function(socket) {
    console.log('connected!')
});

console.log("Running node " + process.version);

This code works perfectly fine if I'm using Node.js version 6.11.2, however on Node.js version 8.9.0, it returns a 525 error when it tries establishing a connection.

My SSL setting is set to Full (strict) on Cloudflare if that matters.

Is there a change in Node v8 for SSL that I'm not aware of?

Any help would be appreciated.

Thanks!

Upvotes: 2

Views: 1166

Answers (1)

Kalana Demel
Kalana Demel

Reputation: 3266

SSL issues has been known to occur after node 8.5.0 onward. The best solution would be to downgrade to 8.5.0 or below till all issues are fixed from node side in a few days.

Sources: Issue

For More Updates : Updates

Upvotes: 1

Related Questions