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