title: Unable to connect to websocket server over https from JavaScript client
body: <p>I have created websocket server for my webrtc app using the following code</p>
  
  <pre><code> const https = require('https');
  const fs = require('fs');
  
  const options = {
      key: fs.readFileSync('C:/.../key_store.key'),
      cert: fs.readFileSync('C:/.../key_store.crt')
  };
  
  var server = https.createServer(options, (req, res) =&gt; { res.writeHead(200); res.end('hello world\n');}).listen(9090);
  
  
  
  //require our websocket library
  var WebSocketServer = require('ws').Server;
  
  //creating a websocket server at port 9090 
  var wss = new WebSocketServer({server});
  </code></pre>
  
  <p>My websocket client code is :</p>
  
  <pre><code>conn = new WebSocket('ws://localhost:9090');
  </code></pre>
  
  <p>I am getting the following exception in JavaScript console when I am trying to connect to websocket server using the above code:</p>
  
  <blockquote>
    <p>VM908:35 WebSocket connection to 'ws://localhost:9090/' failed: Connection closed before receiving a handshake response</p>
  </blockquote>
  
  <p>I tried importing certificates in chrome but with no success.</p>