QTfrontend/net/newnetclient.cpp
changeset 14866 e088bd03812d
parent 14865 90cf07c60feb
child 14903 5119203470f3
--- a/QTfrontend/net/newnetclient.cpp	Wed May 01 00:01:56 2019 +0300
+++ b/QTfrontend/net/newnetclient.cpp	Wed May 01 00:29:46 2019 +0300
@@ -85,7 +85,18 @@
     netClientState = Connecting;
     mynick = nick;
     myhost = hostName + QString(":%1").arg(port);
-    NetSocket.connectToHost(hostName, port);
+    if (useTls)
+    {
+        NetSocket.connectToHostEncrypted(hostName, port);
+        if (!NetSocket.waitForEncrypted())
+        {
+            qWarning("Handshake failed");
+        }
+    }
+    else 
+    {
+        NetSocket.connectToHost(hostName, port);
+    }
 }
 
 void HWNewNet::Disconnect()