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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 7976036: net: make HSTS hosts use the normal SSL interstitials (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 3 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/url_request/url_request_http_job.h ('k') | net/url_request/url_request_job.h » ('j') | 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 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);
} 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) {
« no previous file with comments | « net/url_request/url_request_http_job.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698