aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppOutgoingClient.cpp
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2019-12-14 22:47:28 +0100
committerLNJ <lnj@kaidan.im>2020-01-20 17:14:49 +0100
commit28411b5995553eb3a50c826c55517b4c610959c2 (patch)
treec22ea3b5bd5c1de2831cb3141940038180ce878e /src/client/QXmppOutgoingClient.cpp
parent55966be2e3e80bd5ab2cc86da2492963dd8127ee (diff)
downloadqxmpp-28411b5995553eb3a50c826c55517b4c610959c2.tar.gz
Move TLS negotiation into new QXmppTlsManager
Diffstat (limited to 'src/client/QXmppOutgoingClient.cpp')
-rw-r--r--src/client/QXmppOutgoingClient.cpp42
1 files changed, 1 insertions, 41 deletions
diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp
index 1b73542e..8cbde9e2 100644
--- a/src/client/QXmppOutgoingClient.cpp
+++ b/src/client/QXmppOutgoingClient.cpp
@@ -392,40 +392,9 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv)
QXmppStreamFeatures features;
features.parse(nodeRecv);
- if(features.clientStateIndicationMode() == QXmppStreamFeatures::Enabled)
+ if (features.clientStateIndicationMode() == QXmppStreamFeatures::Enabled)
d->clientStateIndicationEnabled = true;
- if (!socket()->isEncrypted())
- {
- // determine TLS mode to use
- const QXmppConfiguration::StreamSecurityMode localSecurity = configuration().streamSecurityMode();
- const QXmppStreamFeatures::Mode remoteSecurity = features.tlsMode();
- if (!socket()->supportsSsl() &&
- (localSecurity == QXmppConfiguration::TLSRequired ||
- remoteSecurity == QXmppStreamFeatures::Required))
- {
- warning("Disconnecting as TLS is required, but SSL support is not available");
- disconnectFromHost();
- return;
- }
- if (localSecurity == QXmppConfiguration::TLSRequired &&
- remoteSecurity == QXmppStreamFeatures::Disabled)
- {
- warning("Disconnecting as TLS is required, but not supported by the server");
- disconnectFromHost();
- return;
- }
-
- if (socket()->supportsSsl() &&
- localSecurity != QXmppConfiguration::TLSDisabled &&
- remoteSecurity != QXmppStreamFeatures::Disabled)
- {
- // enable TLS as it is support by both parties
- sendData("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");
- return;
- }
- }
-
// handle authentication
const bool nonSaslAvailable = features.nonSaslAuthMode() != QXmppStreamFeatures::Disabled;
const bool saslAvailable = !features.authMechanisms().isEmpty();
@@ -548,15 +517,6 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv)
d->xmppStreamError = QXmppStanza::Error::UndefinedCondition;
emit error(QXmppClient::XmppStreamError);
}
- else if(ns == ns_tls)
- {
- if(nodeRecv.tagName() == "proceed")
- {
- debug("Starting encryption");
- socket()->startClientEncryption();
- return;
- }
- }
else if(ns == ns_sasl)
{
if (!d->saslClient) {