Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Unified Diff: net/url_request/url_request_http_job.cc

Issue 23908005: Handle all non-overridable SSL errors in the same place (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Verified that nothing broke despite time passing Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/cert_status_flags.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 204e22adbcef959ecfb5898bd69d65aacbf95aad..9d9a648e9f2797c5d9d02bdc1f21f97195cc7b3f 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -889,18 +889,27 @@ 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 set it here.
+ SSLInfo info(transaction_->GetResponseInfo()->ssl_info);
+ info.cert_status = MapNetErrorToCertStatus(result);
+ NotifySSLCertificateError(info, true);
+ } else {
+ // Maybe overridable, maybe not. Ask the delegate to decide.
+ 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());
« no previous file with comments | « net/cert/cert_status_flags.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698