Skip to content

tests: the benchmark proxy-tunnel tests don't read the host's certificate store - #2071

Merged
ashhart merged 1 commit into
mainfrom
lead/proxy-tests-hermetic
Nov 4, 2026
Merged

ashhart merged 1 commit into
mainfrom
lead/proxy-tests-hermetic

Conversation

@ashhart

@ashhart ashhart commented Nov 3, 2026

Copy link
Copy Markdown
Owner

The two https-proxy tests in benchmark_stream_test.zig loaded the host's system certificates before connecting. On a Mac where the system keychain can't be read (a sandboxed run, for instance), the load failed with CertificateBundleLoadFailure, so the tunnel test failed. The "refuses to tunnel" test then received no request, and it passed without checking anything.

  • Both clients set .now, so no certificates load. What the tests prove is unchanged: an https exchange through the proxy's tunnel is never sent in clear text, and the refusal happens before TLS.
  • The refusal test now asserts that exactly one CONNECT arrived, for receiver.example.test:443, so it can't pass on zero requests.

Checked by breaking each property. With the proxy forwarding in clear text, both tests fail. With .now dropped from the refusal test, it fails with "expected 1, found 0". zig build test now passes in the sandbox that failed before. Lean is unchanged, and zig fmt is clean.

Both tests set the client's clock so a request never rescans the system
roots; without a readable keychain the fetch failed before connecting,
so the refusal test passed on zero requests and the tunnel test failed.
The refusal test now also requires exactly the one CONNECT it refuses.
@ashhart
ashhart force-pushed the lead/proxy-tests-hermetic branch from 9140943 to bccccbf Compare November 4, 2026 02:57
@ashhart
ashhart merged commit e764c78 into main Nov 4, 2026
1 of 7 checks passed
@ashhart
ashhart deleted the lead/proxy-tests-hermetic branch November 10, 2026 16:34
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.

1 participant