mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-26 00:08:20 -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 <QToolButton>
|
||||||
|
|
||||||
#include "qgsauthmanager.h"
|
#include "qgsauthmanager.h"
|
||||||
|
#include "qgsnetworkaccessmanager.h"
|
||||||
#include "qgsauthcertutils.h"
|
#include "qgsauthcertutils.h"
|
||||||
#include "qgsauthtrustedcasdialog.h"
|
#include "qgsauthtrustedcasdialog.h"
|
||||||
#include "qgscollapsiblegroupbox.h"
|
#include "qgscollapsiblegroupbox.h"
|
||||||
@ -55,6 +56,11 @@ QgsAuthSslErrorsDialog::QgsAuthSslErrorsDialog( QNetworkReply *reply,
|
|||||||
}
|
}
|
||||||
|
|
||||||
setupUi( this );
|
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( buttonBox, &QDialogButtonBox::clicked, this, &QgsAuthSslErrorsDialog::buttonBox_clicked );
|
||||||
connect( btnChainInfo, &QToolButton::clicked, this, &QgsAuthSslErrorsDialog::btnChainInfo_clicked );
|
connect( btnChainInfo, &QToolButton::clicked, this, &QgsAuthSslErrorsDialog::btnChainInfo_clicked );
|
||||||
connect( btnChainCAs, &QToolButton::clicked, this, &QgsAuthSslErrorsDialog::btnChainCAs_clicked );
|
connect( btnChainCAs, &QToolButton::clicked, this, &QgsAuthSslErrorsDialog::btnChainCAs_clicked );
|
||||||
@ -188,6 +194,13 @@ void QgsAuthSslErrorsDialog::buttonBox_clicked( QAbstractButton *button )
|
|||||||
reject();
|
reject();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// Clear access cache
|
||||||
|
if ( QgsSettings().value( QStringLiteral( "clear_auth_cache_on_errors" ),
|
||||||
|
false,
|
||||||
|
QgsSettings::Section::Auth ).toBool( ) )
|
||||||
|
{
|
||||||
|
QgsNetworkAccessManager::instance()->clearAccessCache();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsAuthSslErrorsDialog::populateErrorsList()
|
void QgsAuthSslErrorsDialog::populateErrorsList()
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>617</width>
|
<width>568</width>
|
||||||
<height>710</height>
|
<height>550</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -169,7 +169,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Save SSL server exception</string>
|
<string>Save SSL server e&xception</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -219,14 +219,28 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<property name="orientation">
|
<item>
|
||||||
<enum>Qt::Horizontal</enum>
|
<widget class="QCheckBox" name="cbClearAuthCacheOnErrors">
|
||||||
</property>
|
<property name="toolTip">
|
||||||
<property name="standardButtons">
|
<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>
|
||||||
<set>QDialogButtonBox::Abort|QDialogButtonBox::Ignore|QDialogButtonBox::Save</set>
|
</property>
|
||||||
</property>
|
<property name="text">
|
||||||
</widget>
|
<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>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user