ALPN (Application-Layer Protocol Negotiation)
ALPN (Application-Layer Protocol Negotiation) is a TLS extension defined in RFC 7301, which allows a client and a server to agree within the TLS handshake on which application-layer protocol (e.g. HTTP/1.1, HTTP/2, HTTP/3) they will use over the encrypted connection, without additional communication rounds.
In effect, ALPN streamlines setup: the client sends a list of supported protocols in its ClientHello message, and the server picks one and responds in ServerHello, saving extra negotiation steps.
How it Works in Practice
- During the TLS handshake, the ClientHello includes an ALPN extension listing the application protocols the client supports (for example: “h2” for HTTP/2, “http/1.1”, maybe “h3” for HTTP/3) in order of preference.
- The server checks which protocols it also supports, picks the most suitable one, and sends that choice in the ServerHello (via its own ALPN extension).
- After that point, both sides know exactly which application protocol to use (HTTP/2, HTTP/1.1, etc.), and proceed accordingly.
Because this negotiation happens within the TLS handshake, ALPN avoids extra round trips or separate upgrades – making the setup faster and more efficient.
Why ALPN Matters
- Performance & latency: Because the choice of HTTP/2 or other protocols is made during the handshake, there's no extra waiting or protocol upgrade. This helps pages load faster and reduces overhead.
- Protocol evolution support: ALPN enables modern protocols (HTTP/2, HTTP/3) to be negotiated over the same TLS connections without needing separate ports or extra negotiation logic.
- Security / consistency: The server can even select different certificates or settings depending on which protocol was negotiated.
Hi, we’re Kameleo!
Trusted by thousands of growth hackers, and enterprises worldwide, Kameleo makes browser automation and web scraping smarter, safer, and unstoppable. With our anti-detect browser, you can bypass anti-bot defenses, and stay one step ahead - all with human-like browsers.