Support HTTP/2 (h2) ALPN negotiation in supervisor L7 proxy
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 8.7k
- Forks
- 1.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 253
Description
Problem
The supervisor's L7 TLS proxy hardcodes ALPN to http/1.1 on both the client-facing acceptor and the upstream connector (crates/openshell-supervisor-network/src/l7/tls.rs):
server_config.alpn_protocols = vec![b"http/1.1".to_vec()];
// and
config.alpn_protocols = vec![b"http/1.1".to_vec()];
This means any sandbox application that uses gRPC, Connect-RPC, or any protocol requiring HTTP/2 will fail with:
SSL routines:ssl3_read_bytes:tlsv1 alert no application protocol
The only workaround today is tls: skip for those endpoints, which bypasses L7 inspection entirely.
Context
RFC 0009 explicitly scopes h2 out of v1:
HTTP/2 and HTTP/3. The proxy's TLS termination pins ALPN to
http/1.1today, so these are not introspected.
Meanwhile, the gateway TLS config (crates/openshell-server/src/tls.rs) already negotiates h2:
config.alpn_protocols.extend([b"h2".to_vec(), b"http/1.1".to_vec()]);
So the gateway supports it, but the supervisor proxy doesn't.
Use case
AI coding agents (Cursor, Windsurf, etc.) increasingly use gRPC / Connect-RPC for their API communication, which requires h2. Running these inside OpenShell sandboxes forces tls: skip on all their API endpoints, losing the security benefit of L7 inspection.
Possible approaches
- Full h2 L7 inspection — parse HTTP/2 frames in the MITM path. Most complete but significant effort.
- h2 tunnel without inspection — detect h2 negotiation, relay frames without parsing. Loses L7 hooks but still does TLS termination.
- Auto
tls: skipfallback — if upstream only offers h2 (no http/1.1 fallback), automatically treat the endpoint astls: skip. Pragmatic, minimal code change, and makes the current manual workaround automatic.
Approach 3 would cover the immediate gap with minimal risk.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading crates/openshell-supervisor-network/src/l7/tls.rs and comparing its ALPN handling with crates/openshell-server/src/tls.rs. Review RFC 0009 and determine whether the implementation should inspect h2, tunnel it, or fall back to tls: skip. Done means the selected behavior supports h2 clients without the current no-application-protocol failure and preserves the intended L7 security semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100