SSL Proxy HTTP/2 Inspection with ALPN (TLS 1.2 and TLS 1.3)
Overview
ALPN (Application-Layer Protocol Negotiation) is a TLS extension that lets client and server agree on which application protocol to use inside the TLS tunnel (for example, HTTP/1.1 or HTTP/2). When a client connects using HTTPS, the TLS handshake happens first. During that handshake, the client and server use ALPN to agree on which protocol to use:
http/2 or h2→ Negotiate HTTP/2 ("h2") when the client and server support it and it’s standards-compliant.http/1.1→ Fall back to HTTP/1.1 when HTTP/2 isn’t possible or allowed.
The SSL Proxy supports HTTP/2 only when it’s negotiated correctly via ALPN and meets security rules. You can:
- Allow or block HTTP/2 globally (for all traffic).
- Allow or block HTTP/2 per security policy (example: only for certain sites, users, or applications).
The SSL Proxy removes HTTP/3 (h3) by default and forces clients to
fall back to HTTP/2 (h2), or HTTP/1.1. This feature enables the
negotiation to use only supported protocols ( (HTTP/2 or HTTP/1.1)
When HTTP/2 is negotiated, SSL proxy applies applies different enforcement rules depending onTLS-version-specific enforcement for TLS 1.2 and TLS 1.3. You can confirm the negotiated protocol and enforcement actions by using SSL Proxy status output, counters, and syslog messages.
Benefits of SSL Proxy support for HTTP/2 through ALPN
-
Prevents HTTP/2 sessions from being established with TLS 1.2 cipher suites and behaviors that are not permitted for HTTP/2.
-
Provides predictable protocol fallback by removing unsupported ALPN options (such as
h3and optionallyh2) so connections can continue usingh2orhttp/1.1when available. -
Prevents noncompliant HTTP/2-over-TLS behavior for TLS 1.3 by terminating sessions that attempt prohibited post-handshake client authentication.
-
Ensures consistent protocol-aware handling for TLS 1.3 by propagating the server-selected ALPN value, including when the selection is sent in encrypted handshake messages.
ALPN and Protocol Selection
When ALPN is enabled, the SSL proxy looks at the client’s TLS ClientHello and
checks which application protocols (like h2 for HTTP/2 or
http/1.1) the client supports. It then decides what to pass
to the server.
- If HTTP/2 is turned off (globally or in a specific security policy), the
proxy removes
h2from the list of protocols before connecting to the server.- Result: the server will negotiate
http/1.1(or no ALPN) instead of HTTP/2.
- Result: the server will negotiate
- If the client offers
h3, the proxy removes it by default so the connection can fall back toh2orhttp/1.1, if those are also offered.
- Handling of Post Handshake Message in TLS1.3
- Handling of Prohibited Ciphers in TLS1.2
- Session Renegotiation
Handling of Post Handshake Message in TLS1.3
When using TLS 1.3, the server announces the selected ALPN protocol (for example, HTTP/1.1 or HTTP/2) in the EncryptedExtensions message. The SSL proxy reads this value and uses it to process the connection correctly.
If the server selects HTTP/2 (h2):
- The proxy enforces HTTP/2-over-TLS requirements.
- Some TLS 1.3 features are not allowed with HTTP/2. In particular,
post-handshake client authentication (where the server sends a
CertificateRequestafter the handshake) is not supported. - If the server attempts post-handshake client authentication over HTTP/2, the proxy treats this as an error and closes the connection.
Handling of Prohibited Ciphers in TLS1.2
With TLS 1.2, HTTP/2 has strict requirements about which cipher suites are allowed and about renegotiation.
- If the client offers
h2but only uses TLS 1.2 cipher suites that HTTP/2 forbids:- The proxy removes
h2from the ALPN list before sending the request upstream. - If
http/1.1is also offered, the connection continues as HTTP/1.1.
- The proxy removes
- If the server selects
h2but the final cipher/parameters are not allowed for HTTP/2, The proxy drops the session instead of allowing an invalid HTTP/2 connection. - If either side tries TLS renegotiation after
h2is negotiated, The proxy rejects it with a fatal alert (renegotiation is not allowed for HTTP/2).
Session Renegotiation
For HTTP/2 sessions, TLS renegotiation is typically used by servers to request a client certificate for authentication. The SSL proxy does not support client certificate authentication. When the server requests a client certificate during renegotiation, the proxy sends an empty (zero-length) certificate list. This causes the renegotiation to fail, effectively disabling SSL renegotiation for HTTP/2 sessions through the proxy.
If either the client or the server tries to start renegotiation, the proxy rejects it and sends an alert indicating that renegotiation is not allowed.
Configuration Options
- Disable HTTP/2 At Policy Level or Global Level
- Downgrading HTTP/3 to HTTP/2 or HTTP/1 (Stripping H3 ALPN)
Disable HTTP/2 At Policy Level or Global Level
When HTTP/2 is disabled, the SSL proxy removes h2 (HTTP/2) from the client’s ALPN list before sending the connection to the server. This makes the connection fall back to HTTP/1.1 (or another allowed protocol) instead of using HTTP/2.
HTTP/2 is off by default. You must enable it if you want the device to allow HTTP/2 via ALPN.
- Enable HTTP/2
globally:
user@host# set services ssl proxy global-config http2 on
- Disable HTTP/2
globally:
user@host# set services ssl proxy global-config http2 off
This setting affects all SSL-proxy traffic unless overridden by a policy.
Disable HTTP/2 only for Specific Traffic (per Policy)
If you want HTTP/2 allowed in general, but blocked for certain flows (for example, certain zones, subnets, or applications), you can do this with a security policy:
In the matching policy, add an action that disables HTTP/2 for that traffic:user@host# set security policies from-zone from-zone to-zone to-zone policy policy-name then permit application-services ssl-proxy disable-http2
-
For sessions matching this policy: SSL proxy removes
h2from ALPN (no HTTP/2 for that traffic). -
For all other traffic: The global HTTP/2 setting still applies (on or off as configured).
Downgrading HTTP/3 to HTTP/2 or HTTP/1 (Stripping H3 ALPN)
Junos firewalls don’t support HTTP/3. To accommodate this, the SSL proxy
automatically removes the h3 (HTTP/3) entry from the ALPN list
sent by the client.
When a client includes HTTP/3 in ALPN, the SSL proxy:
- Strips
h3from the ALPN list - Forwards only the remaining protocols (for example, HTTP/2 or HTTP/1.1) to the server
Following table provides ALPN list shared to the server based on client-supported protocols and HTTP/2 setting on SSL proxy.
| Client Supported ALPN List | HTTP/2 | ALPN List Shared to Server By SSL Proxy |
| H1 | OFF | H1 |
| H1 | ON | H1 |
| H2 | OFF | None |
| H2 | ON | H2 |
| H3 | OFF | None |
| H1, H2 | OFF | H1 |
| H1, H2 | ON | H1, H2 |
| H1, H3 | OFF | H1 |
| H1, H3 | ON | H1 |
| H2, H3 | OFF | None |
| H2, H3 | ON | H2 |
| H1, H2, H3 | OFF | H1 |
| H1, H2, H3 | ON | H1, H2 |
Verification Commands
show services ssl proxy status
Use show services ssl proxy status to confirm whether ALPN is
enabled and whether SSL Proxy is removing h2 as shown below.
Example:
user@host> show services ssl proxy status
PIC:fwdd0 fpc[0] pic[0] ------
One-Crypto : Enabled
Async Crypto : Disabled
Proxy-activation : Always
Force-enable-jdpi-service : Disabled
Local Logging : Disabled
SSLFP-PKID Link : UP
Deferred Profile Selection : Enabled
ALPN-Extension :
ALPN-Ext-support : Enabled
Strip-ALPN-h2 : Disabled
Certificate cache : -
Certificate Cache activated : yes
Invalidate certificate cache on CRL update : Disabled
Max cert cache nodes : 4000
Cert cache node in use : 0
Session cache : -
Session cache activated : Activated
Max session cache node : 19660
Session cache node in use : 0
ALPN-Ext-support : Enabled indicates the use of ALPN TLS
extension in its ClientHello / ServerHello messages. With this enabled, the
connection can automatically pick HTTP/2 if both sides support it.
Strip-ALPN-h2 indicates removing h2 from the
ALPN list so that HTTP/2 is not negotiated, even if both sides support it. With
this disabled means, the h2 protocol remains in the ALPN
list.
Above output sample indicates:
- ALPN support is on.
- The system is not blocking/stripping HTTP/2 from ALPN negotiation.
show services ssl termination counters all
Use show services ssl termination counters all to quantify how
often SSL proxy removed h2 from ALPN.
Example:
user@host> show services ssl termination counters all Lsys Name : root-logical-system PIC:fwdd0 fpc[0] pic[0] ------ Memory errors 0 Handshake errors 0 Cert Cache errors 1 Server Protection errors 0 Proxy errors 0 Crypto errors 0 Certificate errors 0 One-Crypto errors 0 Async-Crypto errors 0 Mirror errors 0 handshakes started 3 handshakes completed 2 active sessions 0 Interdicted cert generated 2 proxy: sessions created 3 proxy: sessions active 0 proxy: sessions ignored 0 proxy: renegotiation ignored 0 proxy: session resumption 0 proxy: secure renegotiation 0 proxy: insecure renegotiation 0 proxy: multiple renegotiation 0 proxy: reneg after resumption 0 proxy: reneg initiated by clnt 0 proxy: reneg initiated by srvr 0 init: passthrough requests 0 init: start requests 0 proxy: ECDSA based srvr auth 0 proxy: RSA based srvr auth 0 proxy: strip h2 alpn 0
The proxy: strip h2 alpn indicates the number of sessions
downgraded from HTTP/2 due to the removal of the ALPN ‘h2’ identifier during the
TLS handshake.