allow delegate to provide certificate verifier

This commit is contained in:
Robo 2015-11-05 20:56:46 +05:30
parent 54997db5f2
commit 3dfb75b530
2 changed files with 8 additions and 3 deletions

View file

@ -142,6 +142,10 @@ URLRequestContextGetter::Delegate::CreateHttpCacheBackendFactory(const base::Fil
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
} }
net::CertVerifier* URLRequestContextGetter::Delegate::CreateCertVerifier() {
return net::CertVerifier::CreateDefault();
}
net::SSLConfigService* URLRequestContextGetter::Delegate::CreateSSLConfigService() { net::SSLConfigService* URLRequestContextGetter::Delegate::CreateSSLConfigService() {
return new net::SSLConfigServiceDefaults; return new net::SSLConfigServiceDefaults;
} }
@ -286,7 +290,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
false, // auth_android_negotiate_account_type false, // auth_android_negotiate_account_type
true); // negotiate_enable_port 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_transport_security_state(new net::TransportSecurityState);
storage_->set_ssl_config_service(delegate_->CreateSSLConfigService()); storage_->set_ssl_config_service(delegate_->CreateSSLConfigService());
storage_->set_http_auth_handler_factory(auth_handler_factory); storage_->set_http_auth_handler_factory(auth_handler_factory);

View file

@ -44,6 +44,7 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
content::URLRequestInterceptorScopedVector* protocol_interceptors); content::URLRequestInterceptorScopedVector* protocol_interceptors);
virtual net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory( virtual net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory(
const base::FilePath& base_path); const base::FilePath& base_path);
virtual net::CertVerifier* CreateCertVerifier();
virtual net::SSLConfigService* CreateSSLConfigService(); virtual net::SSLConfigService* CreateSSLConfigService();
virtual bool AllowNTLMCredentialsForDomain(const GURL& auth_origin); virtual bool AllowNTLMCredentialsForDomain(const GURL& auth_origin);
virtual bool CanDelegateURLSecurity(const GURL& auth_origin); virtual bool CanDelegateURLSecurity(const GURL& auth_origin);