| 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..47e58c5cc98851bcc5e870f208bbd80ef1ba7280 100644
|
| --- a/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc
|
| +++ b/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc
|
| @@ -22,7 +22,9 @@
|
| #include "components/content_settings/core/browser/host_content_settings_map.h"
|
| #include "components/content_settings/core/common/content_settings_types.h"
|
| #include "components/variations/variations_associated_data.h"
|
| +#include "content/public/common/content_switches.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 +332,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;
|
|
|
|
|