From 6aa001570da383b60eb72344bf5edbb28725932f Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 13 Sep 2017 15:10:06 +0200 Subject: [PATCH] Fix OpenSSL 1.1 build Fix the 'shared' OpenSSL code for those our users who build with QSSLSOCKET_DEBUG defined and OpenSSL 1.1 detected: the preprocessor-excluded fragment is using old API. Also remove never used in this file (and commented out) macro. Task-number: QTBUG-63170 Change-Id: Id24ccf2955f0a65e4f1dea1ecb06e10245105080 Reviewed-by: Jesus Fernandez --- src/network/ssl/qsslsocket_openssl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 23a63ed0634..2d771b56375 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -54,7 +54,6 @@ ****************************************************************************/ //#define QSSLSOCKET_DEBUG -//#define QT_DECRYPT_SSL_TRAFFIC #include "qssl_p.h" #include "qsslsocket_openssl_p.h" @@ -213,6 +212,7 @@ int q_X509Callback(int ok, X509_STORE_CTX *ctx) if (!ok) { // Store the error and at which depth the error was detected. _q_sslErrorList()->errors << QSslErrorEntry::fromStoreContext(ctx); +#if !QT_CONFIG(opensslv11) #ifdef QSSLSOCKET_DEBUG qCDebug(lcSsl) << "verification error: dumping bad certificate"; qCDebug(lcSsl) << QSslCertificatePrivate::QSslCertificate_from_X509(q_X509_STORE_CTX_get_current_cert(ctx)).toPem(); @@ -233,7 +233,8 @@ int q_X509Callback(int ok, X509_STORE_CTX *ctx) << "ST=" << cert.subjectInfo(QSslCertificate::StateOrProvinceName); qCDebug(lcSsl) << "Valid:" << cert.effectiveDate() << '-' << cert.expiryDate(); } -#endif +#endif // QSSLSOCKET_DEBUG +#endif // !QT_CONFIG(opensslv11) } // Always return OK to allow verification to continue. We handle the // errors gracefully after collecting all errors, after verification has