Chromium Code Reviews| 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 cdb94faeb7e067c069bda0c05117f88b06434a49..08b77626b61672e6de72bed467af3d07ce0f9c2b 100644 |
| --- a/net/url_request/url_request_http_job.cc |
| +++ b/net/url_request/url_request_http_job.cc |
| @@ -686,13 +686,18 @@ void URLRequestHttpJob::OnStartCompleted(int result) { |
| if (result == OK) { |
| SaveCookiesAndNotifyHeadersComplete(); |
| - } else if (ShouldTreatAsCertificateError(result)) { |
| + } else if (IsCertificateError(result)) { |
| // We encountered an SSL certificate error. Ask our delegate to decide |
| // what we should do. |
| - // TODO(wtc): also pass ssl_info.cert_status, or just pass the whole |
| - // ssl_info. |
| - NotifySSLCertificateError( |
| - result, transaction_->GetResponseInfo()->ssl_info.cert); |
| + |
| + TransportSecurityState::DomainState domain_state; |
| + const bool is_hsts_host = |
| + context_->transport_security_state() && |
| + context_->transport_security_state()->IsEnabledForHost( |
| + &domain_state, request_info_.url.host(), |
| + SSLConfigService::IsSNIAvailable(context_->ssl_config_service())); |
| + NotifySSLCertificateError(transaction_->GetResponseInfo()->ssl_info, |
| + is_hsts_host); |
|
wtc
2011/09/26 19:15:10
We can consider making is_hsts_host a bit flag in
|
| } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { |
| NotifyCertificateRequested( |
| transaction_->GetResponseInfo()->cert_request_info); |
| @@ -719,27 +724,6 @@ void URLRequestHttpJob::OnReadCompleted(int result) { |
| NotifyReadComplete(result); |
| } |
| -bool URLRequestHttpJob::ShouldTreatAsCertificateError(int result) { |
| - if (!IsCertificateError(result)) |
| - return false; |
| - |
| - // Revocation check failures are always certificate errors, even if the host |
| - // is using Strict-Transport-Security. |
| - if (result == ERR_CERT_UNABLE_TO_CHECK_REVOCATION) |
| - return true; |
| - |
| - // Check whether our context is using Strict-Transport-Security. |
| - if (!context_->transport_security_state()) |
| - return true; |
| - |
| - TransportSecurityState::DomainState domain_state; |
| - const bool r = context_->transport_security_state()->IsEnabledForHost( |
| - &domain_state, request_info_.url.host(), |
| - SSLConfigService::IsSNIAvailable(context_->ssl_config_service())); |
| - |
| - return !r; |
| -} |
| - |
| void URLRequestHttpJob::RestartTransactionWithAuth( |
| const string16& username, |
| const string16& password) { |