title: Secure WebSocket (wss://) doesn't work on Firefox
body: <p>I have a working WebSocket non secure application. But my website uses https and I need a Secure WebSocket connection to avoid Firefox to complain about the fact that the connection is insecure.</p>
  
  <p>I am using <a href="http://code.google.com/p/php-websocket-server/">php-websocket-server</a> for my WebSocket server with PhP 5.2.9, so when i use WebSocket secure i can't decrypt packets with the openssl_decrypt function. </p>
  
  <p>That's why i used <a href="http://www.stunnel.org/">stunnel</a> in order to decrypt packets sent by the client using wss, to do that i binded client WebSocket to 12345 port an server WebSocket to 54321 port, then i added a stunnel in server mode :</p>
  
  <pre><code>[wsServer]
  accept  = 12345
  connect = 192.168.1.227:54321
  </code></pre>
  
  <p>With this configuration my application works fine on Chrome through https + wss. But on Firefox there's a problem during the handshake, it seems that <code>Sec-WebSocket-Version</code> and <code>Sec-WebSocket-Key</code> are missing in the header. I don't understand because it works on Firefox through http + ws.</p>
  
  <p>Thanks in advance for your help.</p>
  
  <p>Edit : i added an exception for the certificate on the port 12345, now the handshake is going well because i think Firefox now have the <code>Sec-WebSocket-Key</code>.</p>
  
  <p>Here the working header request with Firefox (bigger than Chrome request):</p>
  
  <pre><code>GET / HTTP/1.1
  Host: 192.168.1.227:12345
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/;q=0.8
  Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
  Accept-Encoding: gzip, deflate
  DNT: 1
  Connection: keep-alive, Upgrade
  Sec-WebSocket-Version: 13
  Origin: https://192.168.1.227
  Sec-WebSocket-Protocol: HyBi-00
  Sec-WebSocket-Key: 65nHN33M6drIPjQHcGK8pA==
  Pragma: no-cache
  Cache-Control: no-cache
  Upgrade: websocket
  </code></pre>