title: iOS Safari fails to connect to secure websocket, but works on desktop
body: <p>I have a node.js https server using <em>non</em>-self-signed certificates. I believe they are from godaddy, not sure though. My employer only provided me with key and cert files. </p>
  
  <p><strong>Server:</strong></p>
  
  <pre><code>var fs = require('fs')
    , server = require('https').createServer({
        key: fs.readFileSync( __dirname + "/key.pem" ),
        cert: fs.readFileSync(__dirname + "/cert.pem" )
      })
    , WebSocketServer = require('ws').Server
    , webSocketServer = new WebSocketServer({
        server: server,
      })
    , port = 8080;
  
  server.listen(port, function(){ console.log('Listening on ' + server.address().port) });
  </code></pre>
  
  <p><strong>Client:</strong></p>
  
  <pre><code>var webSocket = new WebSocket('wss://my.website.com:8080');
  </code></pre>
  
  <p>This code works as expected on desktop chrome, safari, and firefox. The client is able to connect to the the secure websocket. However, trying it on iOS 9.3.1 Safari gives me the following error: </p>
  
  <p><strong><code>The operation couldn't be completed.(OSStatus error -9807.)</code></strong></p>
  
  <p><a href="https://www.osstatus.com/search/results?platform=all&amp;framework=all&amp;search=9807" rel="noreferrer">OSStatus</a> showed me that this is caused by an invalid certificate chain. Unfortunately, here is where my knowledge of SSL begins to fade. After some additional googling, I tried multiple combinations of the following options accepted by <code>https.createServer()</code>:</p>
  
  <pre><code>secureProtocol: "SSLv3_method",
  rejectUnauthorized: false,
  ciphers: 'ECDHE-RSA-AES256-SHA:AES256-SHA:RC4-SHA:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM',
  honorCipherOrder: true,
  requestCert: false
  </code></pre>
  
  <p>None of them have worked thus far. I have also seen the <code>ca</code> option (certificate authority) but not only do I not know where I would find this file, all examples online suggest that this is only used with self-signed certs?</p>
  
  <p>Any help is greatly appreciated, thanks!</p>