title: socket.io https ERR_SSL_PROTOCOL_ERROR
body: <p>So basically I've been trying to get https working with my socket.io</p>
  
  <p>server code:</p>
  
  <pre><code>var express = require('express');
  var app = express();
  var httpsapp = express();
  var https = require('https');
  var fs = require("fs");
  var server = https.createServer({
    key: fs.readFileSync('key.pem').toString(),
    cert: fs.readFileSync('cert.crt').toString(),
    ca: fs.readFileSync('ca.pem').toString()
    }, httpsapp);
  var io = require('socket.io').listen(server);
  var io = io.listen(8080);
  (A whole bunch of socket.on's and one that sends one per second (they did work without https))
  </code></pre>
  
  <p>Client code: </p>
  
  <pre><code>var socket = io('https://server.com:8080', {secure: true});
  </code></pre>
  
  <p>I'm being filled to the brim with ERR_SSL_PROTOCOL_ERROR errors
  Does anyone know how to fix this?</p>
  
  <p>Edit: The certs are ones from cloudflare</p>