diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2018-11-30 14:15:45 +0100 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2018-11-30 15:10:07 +0000 |
commit | 096d87c8b01a32083d6819516be17050b0f183a9 (patch) | |
tree | 2864bb04f67f4209f1040b3fdf0701d228ce8e1a /src/network | |
parent | c0dd44556454ce0fa451f83decdad3931a6deaec (diff) |
OpenSSL context (1.1) - make the if-fery/switch less ugly
no need in duplicating DTLS-specific cases.
Change-Id: I475c6fb53daa44d60a5054bf3acc8474355b2186
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/ssl/qsslcontext_openssl11.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/network/ssl/qsslcontext_openssl11.cpp b/src/network/ssl/qsslcontext_openssl11.cpp index 02ce466c80..c96a48dac1 100644 --- a/src/network/ssl/qsslcontext_openssl11.cpp +++ b/src/network/ssl/qsslcontext_openssl11.cpp @@ -97,24 +97,20 @@ init_context: unsupportedProtocol = true; } else { switch (sslContext->sslConfiguration.protocol()) { -#if QT_CONFIG(dtls) case QSsl::DtlsV1_0: case QSsl::DtlsV1_0OrLater: case QSsl::DtlsV1_2: case QSsl::DtlsV1_2OrLater: +#if QT_CONFIG(dtls) isDtls = true; sslContext->ctx = q_SSL_CTX_new(client ? q_DTLS_client_method() : q_DTLS_server_method()); - break; #else // dtls - case QSsl::DtlsV1_0: - case QSsl::DtlsV1_0OrLater: - case QSsl::DtlsV1_2: - case QSsl::DtlsV1_2OrLater: sslContext->ctx = nullptr; unsupportedProtocol = true; qCWarning(lcSsl, "DTLS protocol requested, but feature 'dtls' is disabled"); - break; + #endif // dtls + break; case QSsl::TlsV1_3: case QSsl::TlsV1_3OrLater: #if !defined(TLS1_3_VERSION) |