Node.js and Socket.io: on ssl protocol switching is pending forever
<p>When I want to connect to a node server through client, protocol switching is pending forever. Can someone tell me why that's happening?</p>

<p>Here is the server-side code:</p>

<pre><code>var https = require('https');
var fs = require('fs');

var options = {
    key: fs.readFileSync('*******'),
    cert: fs.readFileSync('*******'),
    passphrase: '*******',
    rejectUnauthorized: false
};

var app = https.createServer(options);
var io = require('socket.io').listen(app);
app.listen(3700);

io.sockets.on('connection', function (client) {

    client.on('join', function() {

        //
    });
});
</code></pre>

<p>And here's the client-side one:</p>

<pre><code>var baseURL          = getBaseURL();
var socketIOPort     = 3700;
var socketIOLocation = baseURL + socketIOPort;
var socket           = io.connect(socketIOLocation, {secure: true,   rejectUnauthorized: false});

function getBaseURL()
{
    return (location.protocol + "//" + location.hostname + ":" + location.port);
}
</code></pre>

<p>I'm using self-signed certificates on localhost.</p>

<p>Mozilla says the connection is aborted and tries to reconnect, Chrome is saying the status is '101 Switching protocols' and time(latency) is 'Pending'.</p>