Skip to content
AdminKit

ALPN (Application-Layer Protocol Negotiation)

What is ALPN (Application-Layer Protocol Negotiation)?

ALPN (Application-Layer Protocol Negotiation) is a TLS extension, defined in RFC 7301, letting a client and server agree which protocol -- h2 or http/1.1 -- to run over a connection inside the TLS handshake, before any data is sent. That negotiation happens inside the same handshake AdminKit's SSL/TLS check inspects, though its result doesn't surface the negotiated protocol.

By AdminKit team, Netbase JSC · Updated

ALPN (Application-Layer Protocol Negotiation) is a TLS extension, defined in RFC 7301, that lets a client and server agree which application protocol to run over a connection as part of the TLS handshake, before any application data is sent. A client’s ClientHello lists the protocols it supports, ordered by preference — h2 and http/1.1 are the pair that matters most in practice — and the server picks one from that list, so neither side needs a separate round trip to find out which to use. This is what lets a single HTTPS port, 443, serve both HTTP/2 (defined in RFC 9113) and plain HTTP/1.1 without guessing: a browser advertising h2 support gets routed to it directly, while an older client falls back to http/1.1 within that same handshake. MDN’s ALPN glossary entry lists the identifiers actually sent on the wire for each protocol, “http/1.1” for HTTP/1.1 and “h2” for HTTP/2. On the server side, a TLS library such as OpenSSL exposes the choice through a callback, SSL_CTX_set_alpn_select_cb, that the server application uses to select which protocol to use for the incoming connection. Negotiation happens inside the same TLS handshake a certificate-and-cipher check like AdminKit’s SSL/TLS check already performs, even though its result doesn’t surface the negotiated protocol itself. Negotiable protocol IDs, including h2 and http/1.1, are tracked in IANA’s TLS Extensions registry, and RFC 7301’s own status is recorded at the IETF Datatracker.

ALPN sits alongside other extensions negotiated within that same ClientHello/ServerHello exchange, such as TLS SNI (which hostname the client is asking for) and the connection’s cipher suite itself — all settled before any application data moves.

ALPN (Application-Layer Protocol Negotiation) is part of AdminKit’s machine protocols cluster; the full AdminKit glossary lists other related terms.

Frequently asked questions

When does ALPN negotiation happen?

Inside the TLS handshake itself -- a client's ClientHello lists the application protocols it supports, and the server picks one, before any application data is sent.

What does ALPN let a single HTTPS port do?

It lets port 443 serve both HTTP/2 and plain HTTP/1.1 without guessing: a browser advertising h2 support gets routed to it directly, while an older client falls back to http/1.1 within the same handshake.

Does ALPN add an extra round trip to the handshake?

No -- the server selects a protocol from the client's advertised list within the existing handshake, so no separate round trip is needed.

Where are negotiable ALPN protocol IDs registered?

In IANA's TLS Extensions registry, which lists identifiers like h2 and http/1.1 under the ALPN Protocol IDs section.