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

Unified Diff: chrome/browser/ssl/chrome_ssl_host_state_delegate.cc

Issue 887223005: Skip interstitials and don't block requests for localhost SSL errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added warning in console on localhost SSL errors Created 5 years, 10 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
Index: chrome/browser/ssl/chrome_ssl_host_state_delegate.cc
diff --git a/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc b/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc
index e179edb926b9ef8df5a97c152f88933e09be8c57..d4c015ae8f17c5380fe468357b1f78ac49000186 100644
--- a/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc
+++ b/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc
@@ -327,6 +327,15 @@ ChromeSSLHostStateDelegate::QueryPolicy(const std::string& host,
scoped_ptr<base::Value> value(map->GetWebsiteSetting(
url, url, CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS, std::string(), NULL));
+ // If the appropriate flag is set, let requests on localhost go
+ // through even if there are certificate errors. Errors on localhost
+ // are unlikely to indicate actual security problems.
+ bool allowLocalhost = base::CommandLine::ForCurrentProcess()->
Ryan Sleevi 2015/02/04 19:34:41 nit: naming wise, this should be allow_localhost (
estark 2015/02/05 03:02:38 Done.
+ HasSwitch(switches::kAllowInsecureLocalhost);
+ if (allowLocalhost && url.DomainIs("localhost")) {
felt 2015/02/04 08:06:54 will it always be normalized to "localhost"? what
estark 2015/02/05 03:02:38 Done -- changed to use net::IsLocalhost, which is
+ return ALLOWED;
+ }
+
// Set a default value in case this method is short circuited and doesn't do a
// full query.
*expired_previous_decision = false;

Powered by Google App Engine
This is Rietveld 408576698