title: Secure websocket connection created with QWebSocket is refused
body: <p>I have a problem with QWebSocket connection with C++.</p>
  
  <pre><code>QWebSocket *mWebSocket = new QWebSocket();
  connect(mWebSocket, SIGNAL(connected()), this, SLOT(connected()));
  connect(mWebSocket, SIGNAL(disconnected()), this, SLOT(disconnected()));
  connect(mWebSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(error(QAbstractSocket::SocketError)));
  
  QNetworkRequest lRequest(QUrl("wss://gateway-predix-data-services.run.aws-usw02-pr.ice.predix.io/v1/stream/messages"));
  lRequest.setRawHeader("Predix-Zone-Id", &lt;my unique id&gt;);
  lRequest.setRawHeader("Authorization", &lt;some token&gt;);
  
  mWebSocket-&gt;open(lRequest);
  </code></pre>
  
  <p>I am getting  3 errors and then disconnect, but never connect.<br/>
  <br/>
  called slot: error<br/>
  QAbstractSocket::RemoteHostClosedError<br/>
  called slot: error<br/>
  QAbstractSocket::ConnectionRefusedError<br/>
  called slot: error<br/>
  QAbstractSocket::RemoteHostClosedError<br/>
  called slot: disconnected<br/>
  <br/>
  When I make a small typo in my token (to test if authentication is ok), I am starting receiving only QAbstractSocket::ConnectionRefusedError error.<br/><br/>
  The most interesting part is that I have implemented websocket connection with python and it works very good, so the problem should not be from websocket server part, or request header setup:</p>
  
  <pre><code>import websocket
  import thread
  import time
  
  def on_message(ws, message):
  print(message)
  
  def on_error(ws, error):
  print(error)
  
  def on_close(ws):
  print("### closed ###")
  
  def on_open(ws):
  def run(*args):
      for i in range(3):
          time.sleep(1)
          #ws.send('{messageId: 1453338376222,body: [{name: Compressor-2017:CompressionRatio,datapoints: [[1453338376222,10,3],[1453338377222,10,1]],attributes: {host: server1,customer: Acme}}]}')
      time.sleep(1)
      #ws.close()
      print("thread terminating...")
  thread.start_new_thread(run, ())
  
  
  if __name__ == "__main__":
  websocket.enableTrace(True)
  ws = websocket.WebSocketApp("wss://gateway-predix-data-services.run.aws-usw02-pr.ice.predix.io/v1/stream/messages",
                            on_message = on_message,
                            on_error = on_error,
                            on_close = on_close,
                            header     = {'Predix-Zone-Id:my unique id', 'Authorization:token'}
                            )
  ws.on_open = on_open
  ws.run_forever()
  </code></pre>
  
  <p>This websocket connection is part of of my c++ sdk, so I need it to be implemented with c++. Do you have any ideas what I have missed in my C++ code?</p>