aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppOutgoingClient.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2012-09-06 09:31:24 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2012-09-06 09:31:24 +0200
commitf3cae1bf1c8199557e2943b33baeec98d656106c (patch)
treedc6df2a110895417bbfde0a1bbfbe4b597c87fd9 /src/client/QXmppOutgoingClient.cpp
parentd413cade5e3b8427f0a7ba7513becd66cb7cc5e0 (diff)
With Qt >= 4.8, verify peer SSL certificate against domain name as specified by RFC 3920.
Diffstat (limited to 'src/client/QXmppOutgoingClient.cpp')
-rw-r--r--src/client/QXmppOutgoingClient.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp
index d6b41202..bb6f0740 100644
--- a/src/client/QXmppOutgoingClient.cpp
+++ b/src/client/QXmppOutgoingClient.cpp
@@ -120,6 +120,11 @@ void QXmppOutgoingClientPrivate::connectToHost(const QString &host, quint16 port
// respect proxy
q->socket()->setProxy(config.networkProxy());
+#if (QT_VERSION >= QT_VERSION_CHECK(4, 8, 0))
+ // set the name the SSL certificate should match
+ q->socket()->setPeerVerifyName(config.domain());
+#endif
+
// connect to host
q->socket()->connectToHost(host, port);
}