Add ALPN to QUIC when using TLS
This CL makes our client send ALPN when using QUIC with TLS, makes the server echo the first ALPN value, and allows quic_client to override the ALPN for IETF interop events.
gfe-relnote: protected by disabled flag quic_supports_tls_handshake
PiperOrigin-RevId: 242682444
Change-Id: I7e60fb61c0afe02283e38598de29df9018b71ee8
diff --git a/quic/core/tls_server_handshaker.h b/quic/core/tls_server_handshaker.h
index 1e9b497..e27d896 100644
--- a/quic/core/tls_server_handshaker.h
+++ b/quic/core/tls_server_handshaker.h
@@ -61,6 +61,14 @@
// |ssl|.
static int SelectCertificateCallback(SSL* ssl, int* out_alert, void* arg);
+ // Calls SelectAlpn after looking up the TlsServerHandshaker from |ssl|.
+ static int SelectAlpnCallback(SSL* ssl,
+ const uint8_t** out,
+ uint8_t* out_len,
+ const uint8_t* in,
+ unsigned in_len,
+ void* arg);
+
private:
class SignatureCallback : public ProofSource::SignatureCallback {
public:
@@ -148,6 +156,12 @@
// |*out_alert| the TLS alert value that the server will send.
int SelectCertificate(int* out_alert);
+ // Selects which ALPN to use based on the list sent by the client.
+ int SelectAlpn(const uint8_t** out,
+ uint8_t* out_len,
+ const uint8_t* in,
+ unsigned in_len);
+
static TlsServerHandshaker* HandshakerFromSsl(SSL* ssl);
State state_ = STATE_LISTENING;