X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientauthhandler.cpp;h=f6fe9acaeeeafc551b0607d82ef6227661e0579b;hp=469299fd457db8eb7d85962bd5077a525ab03578;hb=HEAD;hpb=c0d6dc0dec628f2e143e37ecc95cec45e636f8a5 diff --git a/src/client/clientauthhandler.cpp b/src/client/clientauthhandler.cpp index 469299fd..f6fe9aca 100644 --- a/src/client/clientauthhandler.cpp +++ b/src/client/clientauthhandler.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 * @@ -159,8 +159,7 @@ void ClientAuthHandler::onSocketConnected() stream.setVersion(QDataStream::Qt_4_2); quint32 magic = Protocol::magic; - if (_account.useSsl()) - magic |= Protocol::Encryption; + magic |= Protocol::Encryption; magic |= Protocol::Compression; stream << magic; @@ -253,7 +252,7 @@ void ClientAuthHandler::setPeer(RemotePeer* peer) connect(_peer, &RemotePeer::transferProgress, this, &ClientAuthHandler::transferProgress); // The legacy protocol enables SSL later, after registration - if (!_account.useSsl() || _legacy) + if (_legacy) startRegistration(); // otherwise, do it now else @@ -264,11 +263,7 @@ void ClientAuthHandler::startRegistration() { emit statusMessage(tr("Synchronizing to core...")); - // useSsl will be ignored by non-legacy peers - bool useSsl = false; - useSsl = _account.useSsl(); - - _peer->dispatch(Protocol::RegisterClient(Quassel::Features{}, Quassel::buildInfo().fancyVersionString, Quassel::buildInfo().commitDate, useSsl)); + _peer->dispatch(Protocol::RegisterClient(Quassel::Features{}, Quassel::buildInfo().fancyVersionString, Quassel::buildInfo().commitDate)); } void ClientAuthHandler::handle(const Protocol::ClientDenied& msg) @@ -286,7 +281,7 @@ void ClientAuthHandler::handle(const Protocol::ClientRegistered& msg) _peer->setFeatures(std::move(msg.features)); // The legacy protocol enables SSL at this point - if (_legacy && _account.useSsl()) + if (_legacy) checkAndEnableSsl(msg.sslSupported); else onConnectionReady(); @@ -380,7 +375,7 @@ void ClientAuthHandler::handle(const Protocol::SessionState& msg) void ClientAuthHandler::checkAndEnableSsl(bool coreSupportsSsl) { CoreAccountSettings s; - if (coreSupportsSsl && _account.useSsl()) { + if (coreSupportsSsl) { // Make sure the warning is shown next time we don't have SSL in the core s.setAccountValue("ShowNoCoreSslWarning", true); @@ -415,7 +410,11 @@ void ClientAuthHandler::onSslSocketEncrypted() auto* socket = qobject_cast(sender()); Q_ASSERT(socket); +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) if (!socket->sslErrors().count()) { +#else + if (!socket->sslHandshakeErrors().count()) { +#endif // Cert is valid, so we don't want to store it as known // That way, a warning will appear in case it becomes invalid at some point CoreAccountSettings s;