Deprecate --gfe2_reloadable_flag_quic_new_error_code_for_invalid_hostname.

PiperOrigin-RevId: 686156532
diff --git a/quiche/common/quiche_feature_flags_list.h b/quiche/common/quiche_feature_flags_list.h
index a10db6a..dea7cae 100755
--- a/quiche/common/quiche_feature_flags_list.h
+++ b/quiche/common/quiche_feature_flags_list.h
@@ -39,7 +39,6 @@
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_gfe_allow_alps_new_codepoint, true, true, "If true, allow quic to use new ALPS codepoint to negotiate during handshake for H3 if client sends new ALPS codepoint.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_ignore_gquic_probing, true, true, "If true, QUIC server will not respond to gQUIC probing packet(PING + PADDING) but treat it as a regular packet.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_limit_new_streams_per_loop_2, true, true, "If true, when the peer sends connection options \\\'SLP1\\\', \\\'SLP2\\\' and \\\'SLPF\\\', internet facing GFEs will only allow a limited number of new requests to be processed per event loop, and postpone the rest to the following event loops. Also guard QuicConnection to iterate through all decrypters at each encryption level to get cipher id for a request.")
-QUICHE_FLAG(bool, quiche_reloadable_flag_quic_new_error_code_for_invalid_hostname, true, true, "If true, TlsServerHandshaker will close connection with QUIC_HANDSHAKE_FAILED_INVALID_HOSTNAME, instead of QUIC_HANDSHAKE_FAILED, when the hostname in ClientHello is invalid.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_no_path_degrading_before_handshake_confirmed, true, true, "If true, an endpoint does not detect path degrading or blackholing until handshake gets confirmed.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_no_write_control_frame_upon_connection_close, false, true, "If trrue, early return before write control frame in OnCanWrite() if the connection is already closed.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_no_write_control_frame_upon_connection_close2, false, false, "If true, QuicSession will block outgoing control frames when the connection is closed.")
diff --git a/quiche/quic/core/http/end_to_end_test.cc b/quiche/quic/core/http/end_to_end_test.cc
index c3b99ae..325ace9 100644
--- a/quiche/quic/core/http/end_to_end_test.cc
+++ b/quiche/quic/core/http/end_to_end_test.cc
@@ -1195,15 +1195,9 @@
 
   QuicSpdySession* client_session = GetClientSession();
   ASSERT_TRUE(client_session);
-  if (GetQuicReloadableFlag(quic_new_error_code_for_invalid_hostname)) {
-    EXPECT_THAT(client_session->error(),
-                IsError(QUIC_HANDSHAKE_FAILED_INVALID_HOSTNAME));
-    EXPECT_THAT(client_session->error_details(), HasSubstr("invalid hostname"));
-  } else {
-    EXPECT_THAT(client_session->error(), IsError(QUIC_HANDSHAKE_FAILED));
-    EXPECT_THAT(client_session->error_details(),
-                HasSubstr("select_cert_error: invalid hostname"));
-  }
+  EXPECT_THAT(client_session->error(),
+              IsError(QUIC_HANDSHAKE_FAILED_INVALID_HOSTNAME));
+  EXPECT_THAT(client_session->error_details(), HasSubstr("invalid hostname"));
 }
 
 // Two packet CHLO. The first one is buffered and acked by dispatcher, the
diff --git a/quiche/quic/core/tls_server_handshaker.cc b/quiche/quic/core/tls_server_handshaker.cc
index f74cc2d..20a3f75 100644
--- a/quiche/quic/core/tls_server_handshaker.cc
+++ b/quiche/quic/core/tls_server_handshaker.cc
@@ -961,13 +961,8 @@
     crypto_negotiated_params_->sni =
         QuicHostnameUtils::NormalizeHostname(hostname);
     if (!ValidateHostname(hostname)) {
-      if (GetQuicReloadableFlag(quic_new_error_code_for_invalid_hostname)) {
-        QUIC_RELOADABLE_FLAG_COUNT(quic_new_error_code_for_invalid_hostname);
-        CloseConnection(QUIC_HANDSHAKE_FAILED_INVALID_HOSTNAME,
-                        "invalid hostname");
-      } else {
-        set_extra_error_details("select_cert_error: invalid hostname");
-      }
+      CloseConnection(QUIC_HANDSHAKE_FAILED_INVALID_HOSTNAME,
+                      "invalid hostname");
       return ssl_select_cert_error;
     }
     if (hostname != crypto_negotiated_params_->sni) {