Skip to content

Commit 2d49b1b

Browse files
author
Allan Sandfeld Jensen
committed
Fix sites with optional client certificate support
We fail to load pages that supports client certificates because we didn't implement the client certificate selection. This patch makes a small implementation that selects no certificate whenever a client certificate is requested. Task-number: QTBUG-56206 Change-Id: I95394d9664c7e8e4d03d9e63e5043da81e2672a4 Reviewed-by: Michael Brüning <[email protected]>
1 parent c179992 commit 2d49b1b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/core/content_browser_client_qt.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "content/browser/renderer_host/render_view_host_delegate.h"
4848
#include "content/public/browser/browser_main_parts.h"
4949
#include "content/public/browser/child_process_security_policy.h"
50+
#include "content/public/browser/client_certificate_delegate.h"
5051
#include "content/public/browser/media_observer.h"
5152
#include "content/public/browser/quota_permission_context.h"
5253
#include "content/public/browser/render_frame_host.h"
@@ -434,6 +435,13 @@ void ContentBrowserClientQt::AllowCertificateError(content::WebContents *webCont
434435
*result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY;
435436
}
436437

438+
void ContentBrowserClientQt::SelectClientCertificate(content::WebContents * /*webContents*/,
439+
net::SSLCertRequestInfo * /*certRequestInfo*/,
440+
scoped_ptr<content::ClientCertificateDelegate> delegate)
441+
{
442+
delegate->ContinueWithCertificate(nullptr);
443+
}
444+
437445
content::LocationProvider *ContentBrowserClientQt::OverrideSystemLocationProvider()
438446
{
439447
#ifdef QT_USE_POSITIONING

src/core/content_browser_client_qt.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ class ContentBrowserClientQt : public content::ContentBrowserClient {
102102
bool expired_previous_decision,
103103
const base::Callback<void(bool)>& callback,
104104
content::CertificateRequestResultType* result) Q_DECL_OVERRIDE;
105+
virtual void SelectClientCertificate(content::WebContents* web_contents,
106+
net::SSLCertRequestInfo* cert_request_info,
107+
scoped_ptr<content::ClientCertificateDelegate> delegate) Q_DECL_OVERRIDE;
105108
content::LocationProvider* OverrideSystemLocationProvider() Q_DECL_OVERRIDE;
106109
content::DevToolsManagerDelegate *GetDevToolsManagerDelegate() Q_DECL_OVERRIDE;
107110
virtual net::URLRequestContextGetter *CreateRequestContext(content::BrowserContext *browser_context, content::ProtocolHandlerMap *protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptorss) Q_DECL_OVERRIDE;

0 commit comments

Comments
 (0)