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

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: rebase again 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..cf8f5209eda9f1cf7e7fa2d5efe7e85d91e104c2 100644
--- a/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc
+++ b/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc
@@ -23,6 +23,7 @@
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/variations/variations_associated_data.h"
#include "net/base/hash_value.h"
+#include "net/base/net_util.h"
#include "net/cert/x509_certificate.h"
#include "net/http/http_transaction_factory.h"
#include "net/url_request/url_request_context.h"
@@ -330,6 +331,15 @@ ChromeSSLHostStateDelegate::QueryPolicy(const std::string& host,
// Set a default value in case this method is short circuited and doesn't do a
// full query.
*expired_previous_decision = false;
+
+ // 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 allow_localhost = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAllowInsecureLocalhost);
+ if (allow_localhost && net::IsLocalhost(url.host()))
+ return ALLOWED;
+
if (!value.get() || !value->IsType(base::Value::TYPE_DICTIONARY))
return DENIED;
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698