X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoreauthhandler.cpp;h=294be12e0b9367fc1520806fa81886ad9305a9c3;hp=872c6d1e21179663c6857cd8a203459955c5e340;hb=HEAD;hpb=1a5c1814a0c52f6f35e65c7033b2f896bf1188e3 diff --git a/src/core/coreauthhandler.cpp b/src/core/coreauthhandler.cpp index 872c6d1e..294be12e 100644 --- a/src/core/coreauthhandler.cpp +++ b/src/core/coreauthhandler.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2020 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -26,7 +26,7 @@ #include "core.h" -CoreAuthHandler::CoreAuthHandler(QTcpSocket* socket, QObject* parent) +CoreAuthHandler::CoreAuthHandler(QSslSocket* socket, QObject* parent) : AuthHandler(parent) , _peer(nullptr) , _metricsServer(Core::instance()->metricsServer()) @@ -334,18 +334,13 @@ bool CoreAuthHandler::isLocal() const void CoreAuthHandler::startSsl() { - 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(); + 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(); } void CoreAuthHandler::onSslErrors() { - auto* sslSocket = qobject_cast(socket()); - Q_ASSERT(sslSocket); - sslSocket->ignoreSslErrors(); + socket()->ignoreSslErrors(); }