--- 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()
--- a/QTfrontend/net/newnetclient.h Wed May 01 00:01:56 2019 +0300
+++ b/QTfrontend/net/newnetclient.h Wed May 01 00:29:46 2019 +0300
@@ -22,7 +22,7 @@
#include <QObject>
#include <QString>
-#include <QTcpSocket>
+#include <QSslSocket>
#include <QMap>
#include "team.h"
@@ -69,7 +69,7 @@
QString mynick;
QString myroom;
QString myhost;
- QTcpSocket NetSocket;
+ QSslSocket NetSocket;
QString seed;
bool m_game_connected;
bool m_nick_registered;