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

Unified Diff: net/socket/ssl_client_socket_openssl.cc

Issue 1371263002: Refactor SSLClientSocket::SerializeNextProtos(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move DisableHTTP2 to next_protos. Created 5 years, 3 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 | « net/socket/ssl_client_socket_nss.cc ('k') | net/socket/ssl_client_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9d7289a04ff8650466e1248d5ccc19be5c73db42..743b37834e9228f27d4e00512ecf2ef6db75e98d 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -945,10 +945,12 @@ int SSLClientSocketOpenSSL::Init() {
enabled_ciphers_vector.push_back(id);
}
- std::vector<uint8_t> wire_protos =
- SerializeNextProtos(ssl_config_.next_protos,
- HasCipherAdequateForHTTP2(enabled_ciphers_vector) &&
- IsTLSVersionAdequateForHTTP2(ssl_config_));
+ NextProtoVector next_protos = ssl_config_.next_protos;
+ if (!HasCipherAdequateForHTTP2(enabled_ciphers_vector) ||
+ !IsTLSVersionAdequateForHTTP2(ssl_config_)) {
+ DisableHTTP2(&next_protos);
+ }
+ std::vector<uint8_t> wire_protos = SerializeNextProtos(next_protos);
SSL_set_alpn_protos(ssl_, wire_protos.empty() ? NULL : &wire_protos[0],
wire_protos.size());
}
« no previous file with comments | « net/socket/ssl_client_socket_nss.cc ('k') | net/socket/ssl_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698