title: Socket.IO can't connect through https
body: <p>I have a node.js app, that uses socket.IO. It works fine on http, but when trying to connect to the socket through https - nothing happens.<br>
  Here's some part of the code:  </p>
  
  <pre><code>var fs = require('fs');  
  
  var ioHttp = require('socket.io').listen(8899, {  
      'flash policy port': -1  
  });  
  
  initSocket(ioHttp);  
  
  var ioHttps = require('socket.io').listen(8895, {  
      key: fs.readFileSync('/path/to/file/file.key'),  
      cert: fs.readFileSync('/path/to/file/file.crt'),  
      ca: [  
          fs.readFileSync('/path/to/file/sub.class1.server.ca.pem'),  
          fs.readFileSync('/path/to/file/ca.pem')  
      ],  
      'flash policy port': -1   
  });  
  
  initSocket(ioHttps);  
  </code></pre>
  
  <p>and the <code>initSocket</code> function:  </p>
  
  <pre><code>function initSocket(io) {  
      io.enable('browser client minification');  
      io.enable('browser client etag');  
      io.enable('browser client gzip');  
  
      io.set('transports', [  
          'websocket',  
          'htmlfile',
          'flashsocket',
          'jsonp-polling'  
      ]);  
  
      io.sockets.on('connection', function (client) {
          //the connnection is handled here
      });
  }
  </code></pre>
  
  <p>The client connect like this:   </p>
  
  <pre><code>var secureConnection = false;  
  var port = 8899;
  if (window.location.protocol === 'https:') {  
      port = 8895;
      secureConnection = true;
  }
  
  var socket = io.connect('domain.org', {port: port, secure: secureConnection});
  </code></pre>
  
  <p>As I said everything works fine on http, but connecting on https gives me "The connection was interrupted". What am I doing wrong?</p>