X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoreauthhandler.cpp;h=b28952006cc7c4b295eecaf1bd151b26b0f934bd;hp=8d39d06d1a97122c3a0872efa0c1a8580633094a;hb=145a52eb79fed146731f85c23b60f0609e40e785;hpb=71253052c7152711f7f1b96f274d6f06d97f2cdb diff --git a/src/core/coreauthhandler.cpp b/src/core/coreauthhandler.cpp index 8d39d06d..b2895200 100644 --- a/src/core/coreauthhandler.cpp +++ b/src/core/coreauthhandler.cpp @@ -22,13 +22,11 @@ #include -#ifdef HAVE_SSL -# include -#endif +#include #include "core.h" -CoreAuthHandler::CoreAuthHandler(QTcpSocket* socket, QObject* parent) +CoreAuthHandler::CoreAuthHandler(QSslSocket* socket, QObject* parent) : AuthHandler(parent) , _peer(nullptr) , _metricsServer(Core::instance()->metricsServer()) @@ -336,22 +334,13 @@ bool CoreAuthHandler::isLocal() const void CoreAuthHandler::startSsl() { -#ifdef HAVE_SSL - auto* sslSocket = qobject_cast(socket()); - Q_ASSERT(sslSocket); - qDebug() << qPrintable(tr("Starting encryption for Client:")) << _peer->description(); - connect(sslSocket, selectOverload&>(&QSslSocket::sslErrors), this, &CoreAuthHandler::onSslErrors); - sslSocket->flush(); // ensure that the write cache is flushed before we switch to ssl (bug 682) - sslSocket->startServerEncryption(); -#endif /* HAVE_SSL */ + connect(socket(), selectOverload&>(&QSslSocket::sslErrors), this, &CoreAuthHandler::onSslErrors); + socket()->flush(); // ensure that the write cache is flushed before we switch to ssl (bug 682) + socket()->startServerEncryption(); } -#ifdef HAVE_SSL void CoreAuthHandler::onSslErrors() { - auto* sslSocket = qobject_cast(socket()); - Q_ASSERT(sslSocket); - sslSocket->ignoreSslErrors(); + socket()->ignoreSslErrors(); } -#endif