diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/QXmppStream.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/QXmppStream.cpp b/source/QXmppStream.cpp index 8c09132a..f2a4593f 100644 --- a/source/QXmppStream.cpp +++ b/source/QXmppStream.cpp @@ -318,17 +318,25 @@ void QXmppStream::parser(const QByteArray& data) // determine TLS mode to use const QXmppConfiguration::StreamSecurityMode localSecurity = configuration().streamSecurityMode(); + if (!m_socket.supportsSsl() && + (localSecurity == QXmppConfiguration::TLSRequired || + remoteSecurity == QXmppConfiguration::TLSRequired)) + { + warning("Disconnecting as TLS is required, but SSL support is not available"); + disconnect(); + return; + } if (localSecurity == QXmppConfiguration::TLSRequired && remoteSecurity == QXmppConfiguration::TLSDisabled) { - // disconnect as TLS is required by the client - // but not available on the server - warning("Disconnecting as TLS not available at the server"); + warning("Disconnecting as TLS is required, but not supported by the server"); disconnect(); return; } - if (remoteSecurity == QXmppConfiguration::TLSRequired || - localSecurity != QXmppConfiguration::TLSDisabled) + + if (m_socket.supportsSsl() && + (remoteSecurity == QXmppConfiguration::TLSRequired || + localSecurity != QXmppConfiguration::TLSDisabled)) { // enable TLS as it is required by the server // or supported by the client |
