Index: net/url_request/url_request_http_job.cc |
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc |
index dd11a1b6ef257cb3a35f580a18facc5e8acfebd0..a472d68a9f3159e4c3feae1fe01db3fbf10aaba3 100644 |
--- a/net/url_request/url_request_http_job.cc |
+++ b/net/url_request/url_request_http_job.cc |
@@ -890,18 +890,28 @@ void URLRequestHttpJob::OnStartCompleted(int result) { |
SaveCookiesAndNotifyHeadersComplete(net::OK); |
} else if (IsCertificateError(result)) { |
- // We encountered an SSL certificate error. Ask our delegate to decide |
- // what we should do. |
- |
- TransportSecurityState::DomainState domain_state; |
- const URLRequestContext* context = request_->context(); |
- const bool fatal = context->transport_security_state() && |
- context->transport_security_state()->GetDomainState( |
- request_info_.url.host(), |
- SSLConfigService::IsSNIAvailable(context->ssl_config_service()), |
- &domain_state) && |
- domain_state.ShouldSSLErrorsBeFatal(); |
- NotifySSLCertificateError(transaction_->GetResponseInfo()->ssl_info, fatal); |
+ // We encountered an SSL certificate error. |
+ if (result == ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY || |
+ result == ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN) { |
+ // These are hard failures. They're handled separately and don't have |
+ // the correct cert status, so we set it here. |
Ryan Sleevi
2013/09/10 20:51:27
comment nit: Can you drop the "we", leaving the co
felt
2013/09/10 21:03:21
Done.
|
+ SSLInfo info(transaction_->GetResponseInfo()->ssl_info); |
+ info.cert_status = MapNetErrorToCertStatus(result); |
+ NotifySSLCertificateError(info, true); |
+ } else { |
+ // Maybe overridable, maybe not. |
+ // Ask our delegate to decide what we should do. |
Ryan Sleevi
2013/09/10 20:51:27
comment nit:
// The error may be overridable. Ask
felt
2013/09/10 21:03:21
Done.
|
+ TransportSecurityState::DomainState domain_state; |
+ const URLRequestContext* context = request_->context(); |
+ const bool fatal = context->transport_security_state() && |
+ context->transport_security_state()->GetDomainState( |
+ request_info_.url.host(), |
+ SSLConfigService::IsSNIAvailable(context->ssl_config_service()), |
+ &domain_state) && |
+ domain_state.ShouldSSLErrorsBeFatal(); |
+ NotifySSLCertificateError( |
+ transaction_->GetResponseInfo()->ssl_info, fatal); |
+ } |
} else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { |
NotifyCertificateRequested( |
transaction_->GetResponseInfo()->cert_request_info.get()); |