diff options
| author | Linus Jahn <lnj@kaidan.im> | 2020-01-28 18:26:46 +0100 |
|---|---|---|
| committer | LNJ <lnj@kaidan.im> | 2020-01-29 11:25:43 +0100 |
| commit | 97cb75b28b2a3c5825b55a0541dccaf50e45b35d (patch) | |
| tree | 1bebb765c29348924e06c2044533f6eba6384991 /src/client/QXmppTlsManager.cpp | |
| parent | c7b6ebd872339c4225ed9ddbe4d875def17b7dd6 (diff) | |
| download | qxmpp-97cb75b28b2a3c5825b55a0541dccaf50e45b35d.tar.gz | |
Make QXmppTlsManager an internal client extension
This removes the QXmppTlsManager from the public API and makes it an
internal client extension. It was not of any use for the end user and
was configured via the QXmppClient (as before). This way we can obsolete
some public methods of the QXmppClient, that also have been added with
the new TLS manager.
This can be done without any concerns because the manager was not part
of the public API in any release, yet.
Diffstat (limited to 'src/client/QXmppTlsManager.cpp')
| -rw-r--r-- | src/client/QXmppTlsManager.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/client/QXmppTlsManager.cpp b/src/client/QXmppTlsManager.cpp index 061a3cba..683d6ec2 100644 --- a/src/client/QXmppTlsManager.cpp +++ b/src/client/QXmppTlsManager.cpp @@ -21,27 +21,31 @@ * */ -#include "QXmppTlsManager.h" +#include "QXmppTlsManager_p.h" #include "QXmppConstants_p.h" #include "QXmppClient.h" +#include "QXmppClient_p.h" +#include "QXmppOutgoingClient.h" #include "QXmppStreamFeatures.h" #include "QXmppStartTlsPacket.h" #include <QDomElement> +#include <QSslSocket> +/// \cond QXmppTlsManager::QXmppTlsManager() = default; bool QXmppTlsManager::handleStanza(const QDomElement &stanza) { - if (QXmppStreamFeatures::isStreamFeatures(stanza) && !client()->isSocketEncrypted()) { + if (QXmppStreamFeatures::isStreamFeatures(stanza) && !clientStream()->socket()->isEncrypted()) { QXmppStreamFeatures features; features.parse(stanza); // determine TLS mode to use const QXmppConfiguration::StreamSecurityMode localSecurity = client()->configuration().streamSecurityMode(); const QXmppStreamFeatures::Mode remoteSecurity = features.tlsMode(); - if (!client()->socketSupportsSsl() && + if (!clientStream()->socket()->supportsSsl() && (localSecurity == QXmppConfiguration::TLSRequired || remoteSecurity == QXmppStreamFeatures::Required)) { warning("Disconnecting since TLS is required, but SSL support is not available"); @@ -55,7 +59,7 @@ bool QXmppTlsManager::handleStanza(const QDomElement &stanza) return true; } - if (client()->socketSupportsSsl() && + if (clientStream()->socket()->supportsSsl() && localSecurity != QXmppConfiguration::TLSDisabled && remoteSecurity != QXmppStreamFeatures::Disabled) { // enable TLS since it is supported by both parties @@ -66,9 +70,10 @@ bool QXmppTlsManager::handleStanza(const QDomElement &stanza) if (QXmppStartTlsPacket::isStartTlsPacket(stanza, QXmppStartTlsPacket::Proceed)) { debug("Starting encryption"); - client()->startSocketEncryption(); + clientStream()->socket()->startClientEncryption(); return true; } return false; } +/// \endcond |
