From 36c55eb7eb6da1d078d6e143e770015dd4d50645 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 1 Nov 2019 10:58:24 +0100 Subject: [PATCH] QNetworkReply: Fix SSL configuration handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use QT_CONFIG consistently and enclose sslConfigurationImplementation(), setSslConfigurationImplementation() and ignoreSslErrorsImplementation() within QT_CONFIG as well. This enables a build of Qt for Python with -no-feature-ssl. Fixes: PYSIDE-1302 Change-Id: Ia699293ab73a5dc86d8dcf95aa5f6369334d36a2 Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit 5436a6f3e0a9e7ef7ed51fc5b304e1f81eaed960) --- src/network/access/qnetworkreply.cpp | 5 +++-- src/network/access/qnetworkreply.h | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp index aca9cb1c084..fb30bfd4f18 100644 --- a/src/network/access/qnetworkreply.cpp +++ b/src/network/access/qnetworkreply.cpp @@ -687,7 +687,7 @@ QVariant QNetworkReply::attribute(QNetworkRequest::Attribute code) const return d_func()->attributes.value(code); } -#ifndef QT_NO_SSL +#if QT_CONFIG(ssl) /*! Returns the SSL configuration and state associated with this reply, if SSL was used. It will contain the remote server's @@ -742,7 +742,6 @@ void QNetworkReply::ignoreSslErrors(const QList &errors) { ignoreSslErrorsImplementation(errors); } -#endif /*! \fn void QNetworkReply::sslConfigurationImplementation(QSslConfiguration &configuration) const @@ -786,6 +785,8 @@ void QNetworkReply::ignoreSslErrorsImplementation(const QList &) { } +#endif // QT_CONFIG(ssl) + /*! If this function is called, SSL errors related to network connection will be ignored, including certificate validation diff --git a/src/network/access/qnetworkreply.h b/src/network/access/qnetworkreply.h index 63c2752caf0..4a402daa91a 100644 --- a/src/network/access/qnetworkreply.h +++ b/src/network/access/qnetworkreply.h @@ -143,7 +143,7 @@ public: // attributes QVariant attribute(QNetworkRequest::Attribute code) const; -#ifndef QT_NO_SSL +#if QT_CONFIG(ssl) QSslConfiguration sslConfiguration() const; void setSslConfiguration(const QSslConfiguration &configuration); void ignoreSslErrors(const QList &errors); @@ -157,7 +157,7 @@ Q_SIGNALS: void metaDataChanged(); void finished(); void error(QNetworkReply::NetworkError); -#ifndef QT_NO_SSL +#if QT_CONFIG(ssl) void encrypted(); void sslErrors(const QList &errors); void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator); @@ -182,9 +182,11 @@ protected: void setRawHeader(const QByteArray &headerName, const QByteArray &value); void setAttribute(QNetworkRequest::Attribute code, const QVariant &value); +#if QT_CONFIG(ssl) virtual void sslConfigurationImplementation(QSslConfiguration &) const; virtual void setSslConfigurationImplementation(const QSslConfiguration &); virtual void ignoreSslErrorsImplementation(const QList &); +#endif private: Q_DECLARE_PRIVATE(QNetworkReply)