gfe-relnote: Allow no SNI in TLS QUIC handshake, protected by quic_enable_version_t0XX flags
This allows using a QuicCryptoClientStream with TLS when the QuicServerId
has an empty hostname. It also modifies the server to expose the received
SNI in the crypto_negotiated_params.
//gfe/gfe2/quic:end_to_end_test runs with an empty servername; this change
will be needed to support TLS in that end to end test.
PiperOrigin-RevId: 285099863
Change-Id: I80e94a91824e8b53ed9fd5149a40dd63845fe9b5
diff --git a/quic/core/tls_client_handshaker.cc b/quic/core/tls_client_handshaker.cc
index a65fefc..a222c20 100644
--- a/quic/core/tls_client_handshaker.cc
+++ b/quic/core/tls_client_handshaker.cc
@@ -68,9 +68,10 @@
bool TlsClientHandshaker::CryptoConnect() {
state_ = STATE_HANDSHAKE_RUNNING;
- // Configure the SSL to be a client.
+ // Set the SNI to send, if any.
SSL_set_connect_state(ssl());
- if (SSL_set_tlsext_host_name(ssl(), server_id_.host().c_str()) != 1) {
+ if (!server_id_.host().empty() &&
+ SSL_set_tlsext_host_name(ssl(), server_id_.host().c_str()) != 1) {
return false;
}