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

Unified Diff: net/http/http_network_transaction.cc

Issue 22633004: Handle the TLS version fallback on the bad_record_mac alert error in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Comment fix Created 7 years, 4 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 | « no previous file | net/socket/ssl_client_socket_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.cc
===================================================================
--- net/http/http_network_transaction.cc (revision 216714)
+++ net/http/http_network_transaction.cc (working copy)
@@ -1219,6 +1219,7 @@
GetHostAndPort(request_->url));
}
+ bool should_fallback = false;
uint16 version_max = server_ssl_config_.version_max;
switch (error) {
@@ -1250,20 +1251,35 @@
(server_ssl_config_.unrestricted_ssl3_fallback_enabled ||
!TransportSecurityState::IsGooglePinnedProperty(
request_->url.host(), true /* include SNI */))) {
- net_log_.AddEvent(
- NetLog::TYPE_SSL_VERSION_FALLBACK,
- base::Bind(&NetLogSSLVersionFallbackCallback,
- &request_->url, error, server_ssl_config_.version_max,
- version_max));
- server_ssl_config_.version_max = version_max;
- server_ssl_config_.version_fallback = true;
- ResetConnectionAndRequestForResend();
- error = OK;
+ should_fallback = true;
}
}
break;
+ case ERR_SSL_BAD_RECORD_MAC_ALERT:
+ if (version_max >= SSL_PROTOCOL_VERSION_TLS1_1 &&
+ version_max > server_ssl_config_.version_min) {
+ // Some broken SSL devices negotiate TLS 1.0 when sent a TLS 1.1 or
+ // 1.2 ClientHello, but then return a bad_record_mac alert. See
+ // crbug.com/260358. In order to make the fallback as minimal as
+ // possible, this fallback is only triggered for >= TLS 1.1.
+ version_max--;
wtc 2013/08/09 21:28:31 We can also change version_max directly to SSL_PRO
+ should_fallback = true;
+ }
+ break;
}
+ if (should_fallback) {
+ net_log_.AddEvent(
+ NetLog::TYPE_SSL_VERSION_FALLBACK,
+ base::Bind(&NetLogSSLVersionFallbackCallback,
+ &request_->url, error, server_ssl_config_.version_max,
+ version_max));
+ server_ssl_config_.version_max = version_max;
+ server_ssl_config_.version_fallback = true;
+ ResetConnectionAndRequestForResend();
+ error = OK;
+ }
+
return error;
}
« no previous file with comments | « no previous file | net/socket/ssl_client_socket_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698