You are getting an error because the client can't find the HTTPS resource when it is trying to handshake with the server. To fix this, you will need Socket.IO to listen on an instance of a HTTPS server.
Socket.IO will internally use a HTTP server regardless of if you need one or not. By default, it is a HTTP server, so if you want to use transports over TLS, you will need to manually create a HTTPS server.
var fs = require('fs');
var https = require('https');
var options = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem')
};
var server = https.createServer(options);
var io = require('socket.io').listen(server);
server.listen();