From 88e35246fed9345f540e7f6eb749097fd74f5cfb Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Sun, 6 Apr 2014 12:21:40 +0200 Subject: add support for legacy SSL --- src/client/QXmppConfiguration.h | 9 +++++---- src/client/QXmppOutgoingClient.cpp | 11 ++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src/client') diff --git a/src/client/QXmppConfiguration.h b/src/client/QXmppConfiguration.h index 513075c3..0de57e79 100644 --- a/src/client/QXmppConfiguration.h +++ b/src/client/QXmppConfiguration.h @@ -53,10 +53,11 @@ public: /// Depending upon all this user can specify following options. enum StreamSecurityMode { - TLSEnabled = 0, ///< Encryption is used if available (default) - TLSDisabled, ///< No encryption is server allows - TLSRequired ///< Encryption is a must otherwise connection would not - ///< be established + TLSEnabled = 0, ///< Encryption is used if available (default). + TLSDisabled, ///< No encryption even if the server offers it. + TLSRequired, ///< Encryption must be available, otherwise the + ///< connection will not be established. + LegacySSL ///< Use only legacy SSL mode. }; /// An enumeration for various Non-SASL authentication mechanisms available. diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp index 0ee1d1af..666b0365 100644 --- a/src/client/QXmppOutgoingClient.cpp +++ b/src/client/QXmppOutgoingClient.cpp @@ -129,7 +129,16 @@ void QXmppOutgoingClientPrivate::connectToHost(const QString &host, quint16 port #endif // connect to host - q->socket()->connectToHost(host, port); + const QXmppConfiguration::StreamSecurityMode localSecurity = q->configuration().streamSecurityMode(); + if (localSecurity == QXmppConfiguration::LegacySSL) { + if (!q->socket()->supportsSsl()) { + q->warning("Not connecting as legacy SSL was requested, but SSL support is not available"); + return; + } + q->socket()->connectToHostEncrypted(host, port); + } else { + q->socket()->connectToHost(host, port); + } } /// Constructs an outgoing client stream. -- cgit v1.2.3 From 754314fe90964d84a3514846ebfa5ec16844bd9b Mon Sep 17 00:00:00 2001 From: Juan Aragon Date: Wed, 21 May 2014 16:11:39 +0100 Subject: Advertise support for XEP-0333 --- src/client/QXmppDiscoveryManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/client') diff --git a/src/client/QXmppDiscoveryManager.cpp b/src/client/QXmppDiscoveryManager.cpp index 5188a4e7..7c9a777e 100644 --- a/src/client/QXmppDiscoveryManager.cpp +++ b/src/client/QXmppDiscoveryManager.cpp @@ -115,7 +115,8 @@ QXmppDiscoveryIq QXmppDiscoveryManager::capabilities() << ns_chat_states // XEP-0085: Chat State Notifications << ns_capabilities // XEP-0115: Entity Capabilities << ns_ping // XEP-0199: XMPP Ping - << ns_attention; // XEP-0224: Attention + << ns_attention // XEP-0224: Attention + << ns_chat_markers; // XEP-0333: Chat Markers foreach(QXmppClientExtension* extension, client()->extensions()) { -- cgit v1.2.3 From 6fe36d2854bc730383f0e9d4ec69e410a1c3e062 Mon Sep 17 00:00:00 2001 From: Nikita Krupenko Date: Wed, 4 Jun 2014 13:45:36 +0300 Subject: Added ability to retrieve socket error string for client --- src/client/QXmppClient.cpp | 8 ++++++++ src/client/QXmppClient.h | 1 + 2 files changed, 9 insertions(+) (limited to 'src/client') diff --git a/src/client/QXmppClient.cpp b/src/client/QXmppClient.cpp index 4a5eab9c..daf298be 100644 --- a/src/client/QXmppClient.cpp +++ b/src/client/QXmppClient.cpp @@ -456,6 +456,14 @@ QAbstractSocket::SocketError QXmppClient::socketError() return d->stream->socket()->error(); } +/// Returns the human-readable description of the last socket error if error() is QXmppClient::SocketError. +/// + +QString QXmppClient::socketErrorString() const +{ + return d->stream->socket()->errorString(); +} + /// Returns the XMPP stream error if QXmppClient::Error is QXmppClient::XmppStreamError. /// diff --git a/src/client/QXmppClient.h b/src/client/QXmppClient.h index 985ea97c..b2ca9b96 100644 --- a/src/client/QXmppClient.h +++ b/src/client/QXmppClient.h @@ -149,6 +149,7 @@ public: void setLogger(QXmppLogger *logger); QAbstractSocket::SocketError socketError(); + QString socketErrorString() const; State state() const; QXmppStanza::Error::Condition xmppStreamError(); -- cgit v1.2.3