summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2018-09-11 20:35:13 +0300
committerLisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>2018-09-24 13:40:30 +0000
commit6948bf20a73d09e867fd7c2d89052237d94b7d6a (patch)
tree463fec69c39a161ab57fec35ca2b14b8552432a8 /src
parent4b7ff8e98c0208273a25d84e1f0322cad5bce2bf (diff)
QSslContext: Use 0 instead of TLS_MAX_VERSION
According to the SSL_CTX_set_max_proto_version manpage [1]: > Setting the minimum or maximum version to 0, will enable protocol > versions down to the lowest version, or up to the highest version > supported by the library, respectively. This should make it possible to use Qt Network with older versions of libssl than it was compiled against. In particular, use with 1.1.0 when compiled against 1.1.1. Also, one of OpenSSL developers is suggesting to remove TLS_MAX_VERSION from the public header in the future [2]. [1] https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_max_proto_version.html#DESCRIPTION [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908567#59 Change-Id: Ie76054b917daa8e54d5c0156e848dbaca7bb8a82 Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/network/ssl/qsslcontext_openssl11.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/ssl/qsslcontext_openssl11.cpp b/src/network/ssl/qsslcontext_openssl11.cpp
index 5c68ed41db..4fb33cb0a4 100644
--- a/src/network/ssl/qsslcontext_openssl11.cpp
+++ b/src/network/ssl/qsslcontext_openssl11.cpp
@@ -124,20 +124,20 @@ init_context:
case QSsl::TlsV1SslV3:
case QSsl::AnyProtocol:
minVersion = SSL3_VERSION;
- maxVersion = TLS_MAX_VERSION;
+ maxVersion = 0;
break;
case QSsl::SecureProtocols:
case QSsl::TlsV1_0OrLater:
minVersion = TLS1_VERSION;
- maxVersion = TLS_MAX_VERSION;
+ maxVersion = 0;
break;
case QSsl::TlsV1_1OrLater:
minVersion = TLS1_1_VERSION;
- maxVersion = TLS_MAX_VERSION;
+ maxVersion = 0;
break;
case QSsl::TlsV1_2OrLater:
minVersion = TLS1_2_VERSION;
- maxVersion = TLS_MAX_VERSION;
+ maxVersion = 0;
break;
case QSsl::SslV2:
// This protocol is not supported by OpenSSL 1.1 and we handle