mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-24 00:06:24 -04:00
[auth] Clear network authentication cache on SSL errors
This commit is contained in:
parent
a48c2e8fd4
commit
cde36f3247
@ -25,6 +25,7 @@
|
||||
#include <QToolButton>
|
||||
|
||||
#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()
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>617</width>
|
||||
<height>710</height>
|
||||
<width>568</width>
|
||||
<height>550</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -169,7 +169,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Save SSL server exception</string>
|
||||
<string>Save SSL server e&xception</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
@ -219,14 +219,28 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Abort|QDialogButtonBox::Ignore|QDialogButtonBox::Save</set>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbClearAuthCacheOnErrors">
|
||||
<property name="toolTip">
|
||||
<string><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></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear authentication cache</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Abort|QDialogButtonBox::Ignore|QDialogButtonBox::Save</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
Loading…
x
Reference in New Issue
Block a user