diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-06-21 12:16:00 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-07-08 19:23:08 +0000 |
commit | 10877c3ec0184e6c2a07b8775d32c8efc38a29a3 (patch) | |
tree | e5e1c69e2008205b2178c940c47c1349d6e41c7b /examples | |
parent | a83fd13f62673ce439bdfea55238f9d8ef8676ce (diff) |
Enable client certificate store
Creates the default client cerficate store for the platform and when
given a choice of client certificates forwards to the choice to
the application.
Only a Widgets API for now.
Task-number: QTBUG-54877
Change-Id: Ie15152398d5769579fa0c07e3e3035c2374e9940
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/webenginewidgets/simplebrowser/webpage.cpp | 8 | ||||
-rw-r--r-- | examples/webenginewidgets/simplebrowser/webpage.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/examples/webenginewidgets/simplebrowser/webpage.cpp b/examples/webenginewidgets/simplebrowser/webpage.cpp index fcbb38b8f..353361e4d 100644 --- a/examples/webenginewidgets/simplebrowser/webpage.cpp +++ b/examples/webenginewidgets/simplebrowser/webpage.cpp @@ -57,6 +57,7 @@ #include <QAuthenticator> #include <QMessageBox> #include <QStyle> +#include <QWebEngineCertificateError> WebPage::WebPage(QWebEngineProfile *profile, QObject *parent) : QWebEnginePage(profile, parent) @@ -65,6 +66,7 @@ WebPage::WebPage(QWebEngineProfile *profile, QObject *parent) connect(this, &QWebEnginePage::featurePermissionRequested, this, &WebPage::handleFeaturePermissionRequested); connect(this, &QWebEnginePage::proxyAuthenticationRequired, this, &WebPage::handleProxyAuthenticationRequired); connect(this, &QWebEnginePage::registerProtocolHandlerRequested, this, &WebPage::handleRegisterProtocolHandlerRequested); + connect(this, &QWebEnginePage::selectClientCertificate, this, &WebPage::handleSelectClientCertificate); } bool WebPage::certificateError(const QWebEngineCertificateError &error) @@ -192,3 +194,9 @@ void WebPage::handleRegisterProtocolHandlerRequested(QWebEngineRegisterProtocolH request.reject(); } //! [registerProtocolHandlerRequested] + +void WebPage::handleSelectClientCertificate(QWebEngineClientCertSelection selection) +{ + // Just select one. + selection.select(selection.certificates().at(0)); +} diff --git a/examples/webenginewidgets/simplebrowser/webpage.h b/examples/webenginewidgets/simplebrowser/webpage.h index 0b9ef2abe..9c33d82df 100644 --- a/examples/webenginewidgets/simplebrowser/webpage.h +++ b/examples/webenginewidgets/simplebrowser/webpage.h @@ -69,6 +69,7 @@ private slots: void handleFeaturePermissionRequested(const QUrl &securityOrigin, Feature feature); void handleProxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth, const QString &proxyHost); void handleRegisterProtocolHandlerRequested(QWebEngineRegisterProtocolHandlerRequest request); + void handleSelectClientCertificate(QWebEngineClientCertSelection clientCertSelection); }; #endif // WEBPAGE_H |