From d4ac9f51f6d18a05016e3d61c06eace27501f589 Mon Sep 17 00:00:00 2001 From: Kurt Pattyn <pattyn.kurt@gmail.com> Date: Wed, 12 Mar 2014 14:53:00 +0100 Subject: [PATCH] Add warning to example regarding ignoring ssl errors Change-Id: I3d615a774f4071a085b0f233bef2eac76aefbefb Reviewed-by: Richard J. Moore <rich@kde.org> --- examples/sslechoclient/sslechoclient.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/sslechoclient/sslechoclient.cpp b/examples/sslechoclient/sslechoclient.cpp index cf5b9764..037990d6 100644 --- a/examples/sslechoclient/sslechoclient.cpp +++ b/examples/sslechoclient/sslechoclient.cpp @@ -78,6 +78,11 @@ void SslEchoClient::onTextMessageReceived(QString message) void SslEchoClient::onSslErrors(const QList<QSslError> &errors) { Q_UNUSED(errors); + + // WARNING: Never ignore SSL errors in production code. + // The proper way to handle self-signed certificates is to add a custom root + // to the CA store. + m_webSocket.ignoreSslErrors(); } //! [onTextMessageReceived] -- GitLab