mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Use Qt5 non-OpenSSL define in testing for SSL support
This commit is contained in:
parent
9679b6a68a
commit
4c2725b069
@ -54,7 +54,7 @@
|
||||
#include <QShortcut>
|
||||
#include <QSpinBox>
|
||||
#include <QSplashScreen>
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QSslConfiguration>
|
||||
#endif
|
||||
#include <QStatusBar>
|
||||
@ -110,7 +110,7 @@
|
||||
#include "qgsattributedialog.h"
|
||||
#include "qgsauthmanager.h"
|
||||
#include "qgsauthguiutils.h"
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include "qgsauthcertutils.h"
|
||||
#include "qgsauthsslerrorsdialog.h"
|
||||
#endif
|
||||
@ -11521,7 +11521,7 @@ void QgisApp::namSetup()
|
||||
connect( nam, SIGNAL( requestTimedOut( QNetworkReply* ) ),
|
||||
this, SLOT( namRequestTimedOut( QNetworkReply* ) ) );
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
connect( nam, SIGNAL( sslErrors( QNetworkReply *, const QList<QSslError> & ) ),
|
||||
this, SLOT( namSslErrors( QNetworkReply *, const QList<QSslError> & ) ) );
|
||||
#endif
|
||||
@ -11643,7 +11643,7 @@ void QgisApp::namProxyAuthenticationRequired( const QNetworkProxy &proxy, QAuthe
|
||||
auth->setPassword( password );
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void QgisApp::namSslErrors( QNetworkReply *reply, const QList<QSslError> &errors )
|
||||
{
|
||||
// stop the timeout timer, or app crashes if the user (or slot) takes longer than
|
||||
|
@ -674,7 +674,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
|
||||
//! request credentials for network manager
|
||||
void namAuthenticationRequired( QNetworkReply *reply, QAuthenticator *auth );
|
||||
void namProxyAuthenticationRequired( const QNetworkProxy &proxy, QAuthenticator *auth );
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void namSslErrors( QNetworkReply *reply, const QList<QSslError> &errors );
|
||||
#endif
|
||||
void namRequestTimedOut( QNetworkReply *reply );
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QUuid>
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QtCrypto>
|
||||
#include <QSslConfiguration>
|
||||
#include <QSslError>
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QUuid>
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QtCrypto>
|
||||
#include <QSslConfiguration>
|
||||
#include <QSslError>
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QUuid>
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QtCrypto>
|
||||
#include <QSslConfiguration>
|
||||
#include <QSslError>
|
||||
|
@ -156,7 +156,7 @@ bool QgsAuthMethodConfig::uriToResource( const QString &accessurl, QString *reso
|
||||
}
|
||||
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// QgsPkiBundle
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <QHash>
|
||||
#include <QString>
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QSslCertificate>
|
||||
#include <QSslKey>
|
||||
#include <QSslError>
|
||||
@ -177,7 +177,7 @@ class CORE_EXPORT QgsAuthMethodConfig
|
||||
typedef QHash<QString, QgsAuthMethodConfig> QgsAuthMethodConfigsMap;
|
||||
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
|
||||
/** \ingroup core
|
||||
* \brief Storage set for PKI bundle: SSL certificate, key, optional CA cert chain
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include <QtCrypto>
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QSslConfiguration>
|
||||
#endif
|
||||
|
||||
@ -197,7 +197,7 @@ bool QgsAuthManager::init( const QString& pluginPath )
|
||||
|
||||
updateConfigAuthMethods();
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
initSslCaches();
|
||||
#endif
|
||||
|
||||
@ -258,7 +258,7 @@ bool QgsAuthManager::init( const QString& pluginPath )
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
initSslCaches();
|
||||
#endif
|
||||
|
||||
@ -1572,7 +1572,7 @@ bool QgsAuthManager::removeAuthSetting( const QString& key )
|
||||
}
|
||||
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
|
||||
////////////////// Certificate calls ///////////////////////
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <QSqlQuery>
|
||||
#include <QStringList>
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QSslCertificate>
|
||||
#include <QSslKey>
|
||||
#include <QtCrypto>
|
||||
@ -339,7 +339,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
|
||||
//! Remove an authentication setting
|
||||
bool removeAuthSetting( const QString& key );
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
////////////////// Certificate calls ///////////////////////
|
||||
|
||||
//! Initialize various SSL authentication caches
|
||||
@ -581,7 +581,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
|
||||
|
||||
bool authDbTransactionQuery( QSqlQuery *query ) const;
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void insertCaCertInCache( QgsAuthCertUtils::CaCertSource source, const QList<QSslCertificate> &certs );
|
||||
#endif
|
||||
|
||||
@ -625,7 +625,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
|
||||
int mScheduledDbEraseRequestCount;
|
||||
QMutex *mMutex;
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
// mapping of sha1 digest and cert source and cert
|
||||
// appending removes duplicates
|
||||
QMap<QString, QPair<QgsAuthCertUtils::CaCertSource , QSslCertificate> > mCaCertsCache;
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include <QNetworkReply>
|
||||
#include <QThreadStorage>
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QSslConfiguration>
|
||||
#endif
|
||||
|
||||
@ -182,7 +182,7 @@ QNetworkReply *QgsNetworkAccessManager::createRequest( QNetworkAccessManager::Op
|
||||
userAgent += QStringLiteral( "QGIS/%1" ).arg( Qgis::QGIS_VERSION );
|
||||
pReq->setRawHeader( "User-Agent", userAgent.toUtf8() );
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
bool ishttps = pReq->url().scheme().toLower() == QLatin1String( "https" );
|
||||
if ( ishttps && !QgsAuthManager::instance()->isDisabled() )
|
||||
{
|
||||
@ -305,7 +305,7 @@ void QgsNetworkAccessManager::setupDefaultProxyAndCache()
|
||||
connect( this, SIGNAL( requestTimedOut( QNetworkReply* ) ),
|
||||
smMainNAM, SIGNAL( requestTimedOut( QNetworkReply* ) ) );
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
connect( this, SIGNAL( sslErrors( QNetworkReply *, const QList<QSslError> & ) ),
|
||||
smMainNAM, SIGNAL( sslErrors( QNetworkReply *, const QList<QSslError> & ) ),
|
||||
Qt::BlockingQueuedConnection );
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include <QFile>
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QtCrypto>
|
||||
#include <QSslCertificate>
|
||||
#endif
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <QNetworkRequest>
|
||||
#include <QNetworkReply>
|
||||
#include <QMessageBox>
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QSslError>
|
||||
#endif
|
||||
|
||||
@ -64,7 +64,7 @@ void QgsFileDownloader::startDownload()
|
||||
connect( mReply, &QNetworkReply::finished, this, &QgsFileDownloader::onFinished );
|
||||
connect( mReply, &QNetworkReply::downloadProgress, this, &QgsFileDownloader::onDownloadProgress );
|
||||
connect( nam, &QgsNetworkAccessManager::requestTimedOut, this, &QgsFileDownloader::onRequestTimedOut );
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
connect( nam, &QgsNetworkAccessManager::sslErrors, this, &QgsFileDownloader::onSslErrors );
|
||||
#endif
|
||||
if ( mGuiNotificationsEnabled )
|
||||
@ -89,7 +89,7 @@ void QgsFileDownloader::onRequestTimedOut()
|
||||
error( tr( "Network request %1 timed out" ).arg( mUrl.toString() ) );
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void QgsFileDownloader::onSslErrors( QNetworkReply *reply, const QList<QSslError> &errors )
|
||||
{
|
||||
Q_UNUSED( reply );
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <QFile>
|
||||
#include <QNetworkReply>
|
||||
#include <QProgressDialog>
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QSslError>
|
||||
#endif
|
||||
|
||||
@ -87,7 +87,7 @@ class GUI_EXPORT QgsFileDownloader : public QObject
|
||||
void onRequestTimedOut();
|
||||
//! Called to start the download
|
||||
void startDownload();
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
|
||||
/**
|
||||
* Called on SSL network Errors
|
||||
|
@ -82,7 +82,7 @@ class TestQgsFileDownloader: public QObject
|
||||
void testInvalidFile();
|
||||
void testInvalidUrl();
|
||||
void testBlankUrl();
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void testSslError_data();
|
||||
void testSslError();
|
||||
#endif
|
||||
@ -219,7 +219,7 @@ void TestQgsFileDownloader::testBlankUrl()
|
||||
QCOMPARE( mErrorMessage, QString( "Network error 301: Protocol \"\" is unknown" ) );
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void TestQgsFileDownloader::testSslError_data()
|
||||
{
|
||||
QTest::addColumn<QString>( "url" );
|
||||
|
Loading…
x
Reference in New Issue
Block a user