mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 10:20:17 -06:00
dbhub: Fix wrong certificate being used
When changing the client certificate we need to clear the authentication and access cache of our Qt network access manager instance. If we don't do so, Qt might decide to use the old certificate information which is still in the cache for some recurring queries.
This commit is contained in:
@@ -349,6 +349,15 @@ void RemoteDatabase::fetch(const QString& url, RequestType type, const QString&
|
||||
return;
|
||||
}
|
||||
|
||||
// When the client certificate is different from the one before, clear the access and authentication cache.
|
||||
// Otherwise Qt might use the old certificate again.
|
||||
static QString lastClientCert;
|
||||
if(lastClientCert != clientCert)
|
||||
{
|
||||
lastClientCert = clientCert;
|
||||
m_manager->clearAccessCache();
|
||||
}
|
||||
|
||||
// Fetch database and save pending reply. Note that we're only supporting one active download here at the moment.
|
||||
m_currentReply = m_manager->get(request);
|
||||
m_currentReply->setProperty("type", type);
|
||||
|
||||
Reference in New Issue
Block a user