diff --git a/src/gui/auth/qgsauthsslerrorsdialog.cpp b/src/gui/auth/qgsauthsslerrorsdialog.cpp index d07da786c69..1babf7411e3 100644 --- a/src/gui/auth/qgsauthsslerrorsdialog.cpp +++ b/src/gui/auth/qgsauthsslerrorsdialog.cpp @@ -25,6 +25,7 @@ #include #include "qgsauthmanager.h" +#include "qgsnetworkaccessmanager.h" #include "qgsauthcertutils.h" #include "qgsauthtrustedcasdialog.h" #include "qgscollapsiblegroupbox.h" @@ -55,6 +56,11 @@ QgsAuthSslErrorsDialog::QgsAuthSslErrorsDialog( QNetworkReply *reply, } setupUi( this ); + cbClearAuthCacheOnErrors->setChecked( QgsSettings().value( QStringLiteral( "clear_auth_cache_on_errors" ), false, QgsSettings::Section::Auth ).toBool( ) ); + connect( cbClearAuthCacheOnErrors, &QCheckBox::clicked, this, [ ]( bool checked ) + { + QgsSettings().setValue( QStringLiteral( "clear_auth_cache_on_errors" ), checked, QgsSettings::Section::Auth ); + } ); connect( buttonBox, &QDialogButtonBox::clicked, this, &QgsAuthSslErrorsDialog::buttonBox_clicked ); connect( btnChainInfo, &QToolButton::clicked, this, &QgsAuthSslErrorsDialog::btnChainInfo_clicked ); connect( btnChainCAs, &QToolButton::clicked, this, &QgsAuthSslErrorsDialog::btnChainCAs_clicked ); @@ -188,6 +194,13 @@ void QgsAuthSslErrorsDialog::buttonBox_clicked( QAbstractButton *button ) reject(); break; } + // Clear access cache + if ( QgsSettings().value( QStringLiteral( "clear_auth_cache_on_errors" ), + false, + QgsSettings::Section::Auth ).toBool( ) ) + { + QgsNetworkAccessManager::instance()->clearAccessCache(); + } } void QgsAuthSslErrorsDialog::populateErrorsList() diff --git a/src/ui/auth/qgsauthsslerrorsdialog.ui b/src/ui/auth/qgsauthsslerrorsdialog.ui index b24271731e2..acc8dd77ef3 100644 --- a/src/ui/auth/qgsauthsslerrorsdialog.ui +++ b/src/ui/auth/qgsauthsslerrorsdialog.ui @@ -6,8 +6,8 @@ 0 0 - 617 - 710 + 568 + 550 @@ -169,7 +169,7 @@ - Save SSL server exception + Save SSL server e&xception true @@ -219,14 +219,28 @@ - - - Qt::Horizontal - - - QDialogButtonBox::Abort|QDialogButtonBox::Ignore|QDialogButtonBox::Save - - + + + + + <html><head/><body><p>The authentication cache stores all connections even when the connection fails. </p><p>If you make any change to the authentication configuration or to the CAs you should clear the authentication cache or restart QGIS. </p><p><br/>When this option is checked, it will clear the authentication cache when this dialog is closed.<br/></p></body></html> + + + Clear authentication cache + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Abort|QDialogButtonBox::Ignore|QDialogButtonBox::Save + + + +