summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/profile_adapter.cpp4
-rw-r--r--src/core/profile_adapter.h4
-rw-r--r--src/core/profile_io_data_qt.cpp10
-rw-r--r--src/core/profile_io_data_qt.h4
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp4
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp4
-rw-r--r--tests/auto/core/core.pro4
7 files changed, 33 insertions, 1 deletions
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index 7070292d..6f05c4c3 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -114,7 +114,9 @@ ProfileAdapter::~ProfileAdapter()
m_profile->GetDownloadManager(m_profile.data())->Shutdown();
m_downloadManagerDelegate.reset();
}
+#if QT_CONFIG(ssl)
delete m_clientCertificateStore;
+#endif
Q_ASSERT(m_pageRequestInterceptors == 0);
}
@@ -668,11 +670,13 @@ bool ProfileAdapter::isUsedForGlobalCertificateVerification() const
return m_usedForGlobalCertificateVerification;
}
+#if QT_CONFIG(ssl)
QWebEngineClientCertificateStore *ProfileAdapter::clientCertificateStore()
{
if (!m_clientCertificateStore)
m_clientCertificateStore = new QWebEngineClientCertificateStore(m_profile->m_profileIOData->clientCertificateStoreData());
return m_clientCertificateStore;
}
+#endif
} // namespace QtWebEngineCore
diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h
index 1aff145b..48094a3d 100644
--- a/src/core/profile_adapter.h
+++ b/src/core/profile_adapter.h
@@ -205,7 +205,9 @@ public:
void removePageRequestInterceptor();
bool hasPageRequestInterceptor() const { return m_pageRequestInterceptors > 0; }
+#if QT_CONFIG(ssl)
QWebEngineClientCertificateStore *clientCertificateStore();
+#endif
QHash<QByteArray, QWeakPointer<UserNotificationController>> &ephemeralNotifications()
{ return m_ephemeralNotifications; }
@@ -225,7 +227,9 @@ private:
QScopedPointer<DownloadManagerDelegateQt> m_downloadManagerDelegate;
QScopedPointer<UserResourceControllerHost> m_userResourceController;
QScopedPointer<QWebEngineCookieStore> m_cookieStore;
+#if QT_CONFIG(ssl)
QWebEngineClientCertificateStore *m_clientCertificateStore = nullptr;
+#endif
QPointer<QWebEngineUrlRequestInterceptor> m_requestInterceptor;
QString m_dataPath;
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index f1fe96f8..a73a7c21 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -169,7 +169,9 @@ static net::HttpNetworkSession::Params generateNetworkSessionParams(bool ignoreC
ProfileIODataQt::ProfileIODataQt(ProfileQt *profile)
: m_profile(profile),
+#if QT_CONFIG(ssl)
m_clientCertificateStoreData(new ClientCertificateStoreData),
+#endif
m_mutex(QMutex::Recursive),
m_weakPtrFactory(this)
{
@@ -209,8 +211,10 @@ QPointer<ProfileAdapter> ProfileIODataQt::profileAdapter()
void ProfileIODataQt::shutdownOnUIThread()
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+#if QT_CONFIG(ssl)
delete m_clientCertificateStoreData;
m_clientCertificateStoreData = nullptr;
+#endif
bool posted = content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, this);
if (!posted) {
qWarning() << "Could not delete ProfileIODataQt on io thread !";
@@ -775,14 +779,20 @@ void ProfileIODataQt::updateUsedForGlobalCertificateVerification()
base::BindOnce(&ProfileIODataQt::setGlobalCertificateVerification, m_weakPtr));
}
+#if QT_CONFIG(ssl)
ClientCertificateStoreData *ProfileIODataQt::clientCertificateStoreData()
{
return m_clientCertificateStoreData;
}
+#endif
std::unique_ptr<net::ClientCertStore> ProfileIODataQt::CreateClientCertStore()
{
+#if QT_CONFIG(ssl)
return std::unique_ptr<net::ClientCertStore>(new ClientCertOverrideStore(m_clientCertificateStoreData));
+#else
+ return nullptr;
+#endif
}
// static
diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h
index edb2fd3b..57ddb6fd 100644
--- a/src/core/profile_io_data_qt.h
+++ b/src/core/profile_io_data_qt.h
@@ -124,7 +124,9 @@ public:
void updateUsedForGlobalCertificateVerification(); // runs on ui thread
bool hasPageInterceptors();
+#if QT_CONFIG(ssl)
ClientCertificateStoreData *clientCertificateStoreData();
+#endif
std::unique_ptr<net::ClientCertStore> CreateClientCertStore();
static ProfileIODataQt *FromResourceContext(content::ResourceContext *resource_context);
private:
@@ -148,7 +150,9 @@ private:
QAtomicPointer<net::ProxyConfigService> m_proxyConfigService;
QPointer<ProfileAdapter> m_profileAdapter; // never dereferenced in IO thread and it is passed by qpointer
ProfileAdapter::PersistentCookiesPolicy m_persistentCookiesPolicy;
+#if QT_CONFIG(ssl)
ClientCertificateStoreData *m_clientCertificateStoreData;
+#endif
QString m_cookiesPath;
QString m_channelIdPath;
QString m_httpAcceptLanguage;
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index 3c4ec059..ac75b535 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -1086,8 +1086,12 @@ QQmlListProperty<QQuickWebEngineScript> QQuickWebEngineProfile::userScripts()
*/
QWebEngineClientCertificateStore *QQuickWebEngineProfile::clientCertificateStore()
{
+#if QT_CONFIG(ssl)
Q_D(QQuickWebEngineProfile);
return d->profileAdapter()->clientCertificateStore();
+#else
+ return nullptr;
+#endif
}
QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index 50de63e9..d69ddb34 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -871,8 +871,12 @@ void QWebEngineProfile::clearHttpCache()
*/
QWebEngineClientCertificateStore *QWebEngineProfile::clientCertificateStore()
{
+#if QT_CONFIG(ssl)
Q_D(QWebEngineProfile);
return d->profileAdapter()->clientCertificateStore();
+#else
+ return nullptr;
+#endif
}
QT_END_NAMESPACE
diff --git a/tests/auto/core/core.pro b/tests/auto/core/core.pro
index 5224edbd..376f97f4 100644
--- a/tests/auto/core/core.pro
+++ b/tests/auto/core/core.pro
@@ -1,9 +1,11 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += network-private
SUBDIRS += \
- qwebengineclientcertificatestore \
qwebenginecookiestore \
qwebengineurlrequestinterceptor \
+qtConfig(ssl): SUBDIRS += qwebengineclientcertificatestore
+
# QTBUG-60268
boot2qt: SUBDIRS = ""