From 3dfb75b5302b180e491dbfd363e5f3f8e65cfa57 Mon Sep 17 00:00:00 2001 From: Robo Date: Thu, 5 Nov 2015 20:56:46 +0530 Subject: [PATCH] allow delegate to provide certificate verifier --- brightray/browser/url_request_context_getter.cc | 6 +++++- brightray/browser/url_request_context_getter.h | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index 799560278aaa..3f552b314c89 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -142,6 +142,10 @@ URLRequestContextGetter::Delegate::CreateHttpCacheBackendFactory(const base::Fil BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); } +net::CertVerifier* URLRequestContextGetter::Delegate::CreateCertVerifier() { + return net::CertVerifier::CreateDefault(); +} + net::SSLConfigService* URLRequestContextGetter::Delegate::CreateSSLConfigService() { return new net::SSLConfigServiceDefaults; } @@ -286,7 +290,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { false, // auth_android_negotiate_account_type true); // negotiate_enable_port - storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); + storage_->set_cert_verifier(delegate_->CreateCertVerifier()); storage_->set_transport_security_state(new net::TransportSecurityState); storage_->set_ssl_config_service(delegate_->CreateSSLConfigService()); storage_->set_http_auth_handler_factory(auth_handler_factory); diff --git a/brightray/browser/url_request_context_getter.h b/brightray/browser/url_request_context_getter.h index 0cd31c4c1368..c4e0f9208a17 100644 --- a/brightray/browser/url_request_context_getter.h +++ b/brightray/browser/url_request_context_getter.h @@ -44,14 +44,15 @@ class URLRequestContextGetter : public net::URLRequestContextGetter { content::URLRequestInterceptorScopedVector* protocol_interceptors); virtual net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory( const base::FilePath& base_path); + virtual net::CertVerifier* CreateCertVerifier(); virtual net::SSLConfigService* CreateSSLConfigService(); virtual bool AllowNTLMCredentialsForDomain(const GURL& auth_origin); virtual bool CanDelegateURLSecurity(const GURL& auth_origin); - + private: scoped_ptr orig_url_sec_mgr_; }; - + class DelegateURLSecurityManager : public net::URLSecurityManager { public: DelegateURLSecurityManager(URLRequestContextGetter::Delegate* delegate);