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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 6873029: Apply HSTS rules to also upgrade ws:// -> wss:// if appropriate. This avoids (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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: net/url_request/url_request_http_job.cc
===================================================================
--- net/url_request/url_request_http_job.cc (revision 81709)
+++ net/url_request/url_request_http_job.cc (working copy)
@@ -183,7 +183,7 @@
request->context()->transport_security_state()->IsEnabledForHost(
&domain_state,
request->url().host(),
- IsSNIAvailable(request->context()))) {
+ request->context()->IsSNIAvailable())) {
if (domain_state.mode ==
TransportSecurityState::DomainState::MODE_STRICT) {
DCHECK_EQ(request->url().scheme(), "http");
@@ -665,7 +665,7 @@
if (context_->transport_security_state()->IsEnabledForHost(
&domain_state,
request_->url().host(),
- IsSNIAvailable(context_)) &&
+ context_->IsSNIAvailable()) &&
ssl_info.is_issued_by_known_root &&
!domain_state.IsChainOfPublicKeysPermitted(ssl_info.public_key_hashes)){
result = ERR_CERT_INVALID;
@@ -720,7 +720,7 @@
TransportSecurityState::DomainState domain_state;
// TODO(agl): don't ignore opportunistic mode.
const bool r = context_->transport_security_state()->IsEnabledForHost(
- &domain_state, request_info_.url.host(), IsSNIAvailable(context_));
+ &domain_state, request_info_.url.host(), context_->IsSNIAvailable());
return !r || domain_state.mode ==
TransportSecurityState::DomainState::MODE_OPPORTUNISTIC;
@@ -1370,14 +1370,4 @@
IsSupportedNonImageMimeType(mime_type.c_str()));
}
-// static
-bool URLRequestHttpJob::IsSNIAvailable(URLRequestContext* context) {
- if (!context->ssl_config_service())
- return false;
-
- SSLConfig ssl_config;
- context->ssl_config_service()->GetSSLConfig(&ssl_config);
- return ssl_config.tls1_enabled;
-}
-
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698