Skip to main content
tls

ALPN (Application-Layer Protocol Negotiation)

ALPN is a TLS extension that negotiates the application protocol (HTTP/1.1, h2, h3) during the TLS handshake, eliminating an extra round trip. The client lists supported protocols in ClientHello; the server selects one in ServerHello. HTTP/2 requires ALPN – browsers will not use h2 without it. Also used for ACME tls-alpn-01 validation.

Definition

Application-Layer Protocol Negotiation allows client and server to agree on the application protocol within the TLS handshake itself. The client sends a list of supported protocols (e.g., h2, http/1.1) in the ClientHello ALPN extension. The server selects the highest-priority mutual match and confirms in ServerHello. This avoids the extra round trip that NPN (Next Protocol Negotiation, deprecated predecessor) required. ALPN is mandatory for HTTP/2 over TLS – browsers refuse to use h2 without ALPN negotiation. ALPN values are IANA-registered: 'h2' for HTTP/2, 'http/1.1' for HTTP/1.1, 'h3' for HTTP/3 (over QUIC). The ACME protocol uses ALPN for domain validation: the tls-alpn-01 challenge requires responding with a specific self-signed certificate when the CA connects with ALPN protocol 'acme-tls/1'.

Examples

  • openssl s_client -connect host:443 -alpn h2,http/1.1 (negotiates protocol)
  • Nginx: listen 443 ssl; http2 on; (advertises h2 via ALPN)
  • curl -v https://host | grep ALPN (shows negotiated protocol)

Related Protocols

Related Terms