diff options
Diffstat (limited to 'net/socket/ssl_client_socket_openssl.cc')
-rw-r--r-- | net/socket/ssl_client_socket_openssl.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc index 9fc6454..6775763 100644 --- a/net/socket/ssl_client_socket_openssl.cc +++ b/net/socket/ssl_client_socket_openssl.cc @@ -952,10 +952,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()); } |