Skip to content

http: streams use the proxy route and a trusted CA, as fetch does - #496

Merged
paymog merged 1 commit into
mainfrom
feat/stream-proxy-ca-471
Oct 19, 2026
Merged

paymog merged 1 commit into
mainfrom
feat/stream-proxy-ca-471

Conversation

@paymog

@paymog paymog commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Http.open and Http.open.how now connect the way fetch does. Before this change, stream.origin called conn.open.all directly. That skipped the proxy choice, so a program behind HTTPS_PROXY could fetch a URL but could not open a stream to it. It also passed "" as the CA, so a stream to a server with a private CA failed where fetch.ca succeeded.

Changes

  • origin.route builds the pool key, the request as sent, and the Route (RouteDirect or RouteProxy) for one origin. The pool path (pool.origin.route) and the stream path (stream.route) both use it, so they cannot drift apart. The proxy rules are the same: an HTTP proxy gets an absolute-form target and Proxy-Authorization, and an HTTPS proxy gets CONNECT before TLS.
  • stream.one.of calls proxy.select, as pool.one.of does.
  • route.open takes the h2 ALPN offer flag. Pools pass True. Streams pass False, because a stream speaks HTTP/1.1 only.
  • open.how, open.raw.how, and open.how.enc take ca after cert. StreamHops carries it. A redirect keeps the CA only on the same origin (stream.trust, using pool.next.ca).

Breaking: http 0.35.0.0 → 0.36.0.0. No sibling calls open.how or open.raw.how. Siblings stay on 0.35.0.0 until a re-pin wave.

Verification

  • scripts/check.sh http: exit 0. check.bend now sends a forward stream and a CONNECT stream through the local proxy. The proxy checks the absolute-form target, the Host header, and Proxy-Authorization, and it sees the CONNECT authority.
  • http/ca-check.sh (native): open.how with the test CA follows a redirect and reads ok. With "", it fails with ErrTls 100.
  • http/mtls-check.sh (native): all mTLS stream and fetch checks pass with the new open.how signature.
  • scripts/publish.sh --check: [email protected] will publish.

Closes #471
Refs #440

open and open.how now pick RouteDirect or RouteProxy through proxy.select, as pool.one.of does. open.how and open.raw.how take a CA file after cert; it follows only same-origin hops. origin.route is the shared key, request, and route choice for the pool and the stream. http 0.36.0.0.

Closes #471
@paymog
paymog merged commit d8d48e9 into main Oct 19, 2026
4 checks passed
@paymog
paymog deleted the feat/stream-proxy-ca-471 branch October 19, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Http: stream opens use the proxy route and a trusted CA, as fetch does

1 participant