diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-01 12:57:44 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-10-17 10:44:07 +0000 |
commit | 0b1025b8aea4aa0336671f7e908287d65490d120 (patch) | |
tree | 77c201fee93d3c184ce5b6b28d55fc01dc4a6d9e /src/core/profile_adapter.cpp | |
parent | 7b886ab2cdfc94cc70477f51bd28961de52e989c (diff) | |
download | qtwebengine-0b1025b8aea4aa0336671f7e908287d65490d120.tar.gz |
Make it possible to enable OCSP on Linux
The code follows Chromium and also set a CertNetFetcher on both Linux
and macOS, but it appears to be currently unused.
[ChangeLog][QWebEngineProfile] A profile can now be designated to
download OCSP records and thus enable OCSP verification on Linux.
Task-number: QTBUG-58059
Task-number: QTBUG-71164
Change-Id: I84fd34d4351cb7aa4417ce4058f97bad4b8d0cd4
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/core/profile_adapter.cpp')
-rw-r--r-- | src/core/profile_adapter.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp index 86b16fd2c..57bf3e752 100644 --- a/src/core/profile_adapter.cpp +++ b/src/core/profile_adapter.cpp @@ -48,6 +48,7 @@ #include "download_manager_delegate_qt.h" #include "net/url_request_context_getter_qt.h" #include "permission_manager_qt.h" +#include "profile_adapter_client.h" #include "profile_qt.h" #include "renderer_host/user_resource_controller_host.h" #include "type_conversion.h" @@ -546,4 +547,34 @@ void ProfileAdapter::resetVisitedLinksManager() m_visitedLinksManager.reset(new VisitedLinksManagerQt(this)); } +void ProfileAdapter::setUseForGlobalCertificateVerification(bool enable) +{ + if (m_usedForGlobalCertificateVerification == enable) + return; + + static QPointer<ProfileAdapter> profileForglobalCertificateVerification; + + m_usedForGlobalCertificateVerification = enable; + if (enable) { + if (profileForglobalCertificateVerification) { + profileForglobalCertificateVerification->m_usedForGlobalCertificateVerification = false; + for (auto *client : qAsConst(profileForglobalCertificateVerification->m_clients)) + client->useForGlobalCertificateVerificationChanged(); + } + profileForglobalCertificateVerification = this; + } else { + Q_ASSERT(profileForglobalCertificateVerification); + Q_ASSERT(profileForglobalCertificateVerification == this); + profileForglobalCertificateVerification = nullptr; + } + + if (m_profile->m_urlRequestContextGetter.get()) + m_profile->m_profileIOData->updateUsedForGlobalCertificateVerification(); +} + +bool ProfileAdapter::isUsedForGlobalCertificateVerification() const +{ + return m_usedForGlobalCertificateVerification; +} + } // namespace QtWebEngineCore |