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 | |
| 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')
| -rw-r--r-- | src/client/QXmppClient.cpp | 2 | ||||
| -rw-r--r-- | src/client/QXmppTlsManager.cpp | 15 | ||||
| -rw-r--r-- | src/client/QXmppTlsManager_p.h (renamed from src/client/QXmppTlsManager.h) | 19 |
3 files changed, 27 insertions, 9 deletions
diff --git a/src/client/QXmppClient.cpp b/src/client/QXmppClient.cpp index 7763676b..5fb1b869 100644 --- a/src/client/QXmppClient.cpp +++ b/src/client/QXmppClient.cpp @@ -33,7 +33,7 @@ #include "QXmppMessage.h" #include "QXmppUtils.h" -#include "QXmppTlsManager.h" +#include "QXmppTlsManager_p.h" #include "QXmppRosterManager.h" #include "QXmppVCardManager.h" #include "QXmppVersionManager.h" 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 diff --git a/src/client/QXmppTlsManager.h b/src/client/QXmppTlsManager_p.h index 086bfdf7..562ac273 100644 --- a/src/client/QXmppTlsManager.h +++ b/src/client/QXmppTlsManager_p.h @@ -21,18 +21,31 @@ * */ +// +// W A R N I N G +// ------------- +// +// This file is not part of the QXmpp API. +// +// This header file may change from version to version without notice, +// or even be removed. +// +// We mean it. +// + #ifndef QXMPPTLSMANAGER_H #define QXMPPTLSMANAGER_H -#include "QXmppClientExtension.h" +#include "QXmppInternalClientExtension_p.h" +/// /// \brief The QXmppTlsManager enables the QXmppClient to use STARTTLS. It is /// added to the client by default and can be configured using the /// \c QXmppConfiguration class. /// /// \ingroup Managers - -class QXMPP_EXPORT QXmppTlsManager : public QXmppClientExtension +/// +class QXmppTlsManager : public QXmppInternalClientExtension { Q_OBJECT |
