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

Unified Diff: net/socket/ssl_client_socket_openssl.cc

Issue 947603002: Shard the SSL session cache by version fallback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: be more clever 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: net/socket/ssl_client_socket_openssl.cc
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index 764ce9ee71b91219c684c82319507783bf41c6f5..a84dbc2070a23fcdde613661d396232d97a9c11c 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -403,6 +403,27 @@ std::string SSLClientSocketOpenSSL::GetSessionCacheKey() const {
std::string result = host_and_port_.ToString();
result.append("/");
result.append(ssl_session_cache_shard_);
+
+ // Shard the session cache based on maximum protocol version. This causes
+ // fallback connections to use a separate session cache.
+ result.append("/");
+ switch (ssl_config_.version_max) {
+ case SSL_PROTOCOL_VERSION_SSL3:
+ result.append("ssl3");
+ break;
+ case SSL_PROTOCOL_VERSION_TLS1:
+ result.append("tls1");
+ break;
+ case SSL_PROTOCOL_VERSION_TLS1_1:
+ result.append("tls1.1");
+ break;
+ case SSL_PROTOCOL_VERSION_TLS1_2:
+ result.append("tls1.2");
+ break;
+ default:
+ NOTREACHED();
+ }
+
return result;
}

Powered by Google App Engine
This is Rietveld 408576698