ALPN
also: Application Layer Protocol Negotiation
ALPN (Application Layer Protocol Negotiation) is a TLS extension that allows the client and server to agree on which application protocol to use during the initial TLS handshake, avoiding extra round trips.
ALPN is a TLS extension (defined in RFC 7301) that negotiates the application protocol before the encrypted connection is fully established. Without ALPN, a client must complete the TLS handshake first, then send an HTTP request to discover server capabilities—requiring extra latency.
The client sends a list of supported protocols (like h2 for HTTP/2 or http/1.1 for HTTP/1.1) in the TLS ClientHello message. The server selects one and includes it in the ServerHello, so both sides agree on the protocol before data transmission begins.
Example: when you access an HTTPS website, ALPN lets the browser and server agree to use HTTP/2 in a single handshake rather than connecting with HTTP/1.1 first and then upgrading. This improves performance by reducing round-trip time.