[feature] Enable HTTP/2 for jetty#6485
Conversation
|
CoPilot: I'll load the PR understanding ability and then review your PR for HTTP/2 support in Jetty.Now let me fetch the PR details and related information:Now let me get the individual files to review the configuration changes in detail:## Review Summary Status: ✅ Ready to merge — 2 approvals, clean CI state, solid implementation. Your HTTP/2 feature implementation is comprehensive and well-configured. Here's my detailed assessment: ✅ What's Done RightDependencies: All required Jetty HTTP/2 modules are added with proper scoping:
Configuration: Your connector setup correctly prioritizes HTTP/2 in the handshake: <ALPNServerConnectionFactory>
<protocols>
<Item>h2</Item> <!-- HTTP/2 preferred -->
<Item>http/1.1</Item> <!-- Fallback -->
</protocols>
<defaultProtocol>http/1.1</defaultProtocol>
</ALPNServerConnectionFactory>Cleartext HTTP/2 (h2c): Enabled via Security hardening: TLS ciphers strengthened by excluding legacy/weak algorithms (CBC, SHA-only, SSLv2/v3, TLSv1.0/1.1). Performance: Direct byte buffers enabled ( Tested: Evidence shows successful HTTP/2 negotiation on HTTPS (h2) and cleartext HTTP (h2c upgrade).
|
outcome:
(plain)
(force http2)
(https):
Browsers will only use HTTP/2 with Jetty if all the protocol and TLS prerequisites are met; if you see HTTP/1.1 in Safari/Chrome, it usually means you are hitting cleartext HTTP or your HTTPS/ALPN/TLS setup is incomplete.
Key points to check
• Use HTTPS, not HTTP. All major browsers only speak HTTP/2 as h2 over TLS, not cleartext h2c , so http://... will stay on HTTP/1.1 while curl --http2-prior-knowledge can still talk h2c.
• ALPN must advertise h2 . Your Jetty TLS connector has to be configured with HTTP/2 support (http2 module / HTTP2ServerConnectionFactory ) and ALPN so that the TLS handshake offers h2 to the browser.
• Cipher suites and protocol order. HTTP/2 requires modern ciphers; Jetty usually needs you to prefer HTTP/2‑compatible ciphers and list HTTP/2 before HTTP/1.1 in the protocol preference, otherwise some browsers will negotiate down to HTTP/1.1.
• Hostnames and certificates. Use a proper hostname with a certificate whose CN/SAN matches it; some browsers have special rules or limitations for localhost or raw IPs with TLS that can interfere with HTTP/2