summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslcontext_openssl.cpp
diff options
context:
space:
mode:
authorMikkel Krautz <mikkel@krautz.dk>2015-02-13 11:57:41 +0100
committerMikkel Krautz <mikkel@krautz.dk>2015-02-13 16:48:43 +0000
commitbf3246fdff321b4f07f88c697102c8ef5a7969d0 (patch)
tree3bf1a7d41fd7cdb57c5707c28557a21cc9a3c12a /src/network/ssl/qsslcontext_openssl.cpp
parent651329adb5e64b18a005e900e1b9c5e95d70258c (diff)
QSsl: add TlsV1_0OrLater, TlsV1_1OrLater, TlsV1_2OrLater
Change-Id: I90b99fb515dcf559824f673d2304081238541c4c Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network/ssl/qsslcontext_openssl.cpp')
-rw-r--r--src/network/ssl/qsslcontext_openssl.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/network/ssl/qsslcontext_openssl.cpp b/src/network/ssl/qsslcontext_openssl.cpp
index 71fa36b921..f91af9db74 100644
--- a/src/network/ssl/qsslcontext_openssl.cpp
+++ b/src/network/ssl/qsslcontext_openssl.cpp
@@ -177,7 +177,23 @@ init_context:
unsupportedProtocol = true;
#endif
break;
+ case QSsl::TlsV1_0OrLater:
+ // Specific protocols will be specified via SSL options.
+ sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
+ break;
+ case QSsl::TlsV1_1OrLater:
+ case QSsl::TlsV1_2OrLater:
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+ // Specific protocols will be specified via SSL options.
+ sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
+#else
+ // TLS 1.1/1.2 not supported by the system, but chosen deliberately -> error
+ sslContext->ctx = 0;
+ unsupportedProtocol = true;
+#endif
+ break;
}
+
if (!sslContext->ctx) {
// After stopping Flash 10 the SSL library looses its ciphers. Try re-adding them
// by re-initializing the library.