Networking also: Application-Layer Protocol Negotiation

ALPN

TLS extension that picks h2 / h3 / http/1.1 inside the handshake.


In plain terms

Avoids a second round trip after TLS finishes. Also how WebRTC and gRPC tell the server what protocol to switch to.

Origin

RFC 7301 (2014). Replaced the older NPN extension. Without ALPN you'd need an extra round-trip after the TLS handshake to negotiate HTTP/2 vs HTTP/1.1.

Where it shows up in production
  • HTTP/2 negotiation Every HTTP/2 client offers h2 and http/1.1 in the ClientHello; server picks one.
  • gRPC ALPN selects h2 because gRPC mandates HTTP/2.
On Semicolony
Sources & further reading
Found this useful?