Skip to content

[PR] fix(proxy): apply configured CA trust to both TLS connectors - #6583

Merged
ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-13_proxy-ca-trust
Nov 14, 2026
Merged

ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-13_proxy-ca-trust

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Fixes #6582

Problem

Configured private CA roots never reach the actual TLS connectors used for proxied model requests. Undici replaces the top-level connect option inside ProxyAgent, and the raw HTTPS CONNECT helper does not pass the configured roots. This leaves private upstream endpoints and HTTPS proxies unavailable even with a correct BILI_CA_FILE.

Change

Pass the existing merged CA bundle as requestTls.ca and proxyTls.ca for ProxyAgent, and as ca for the raw HTTPS-proxy socket. No certificate or hostname verification is disabled. An absent custom CA retains the platform defaults. The shared outbound transport serves both plugin and proxy modes; no wire/message or kernel change is involved.

Verification

  • Nine new real loopback TLS tests use local target and CONNECT-proxy servers with ephemeral ports.
  • Unchanged master e1f31ad9d5b47500362699a9867819b861c7de96: all four trusted proxy scenarios fail; five rejection controls pass.
  • Fixed branch: HTTPS target through HTTP proxy, HTTP target through HTTPS proxy, HTTPS through HTTPS proxy, and raw HTTPS CONNECT all succeed.
  • Untrusted target/proxy certificates, untrusted raw HTTPS CONNECT, and wrong target/proxy hostnames still fail with TLS verification errors.
  • 45 related tests across four files pass; typecheck, full build, unused-export check, test-import-graph check and git diff --check pass.
  • Remote Git tree matches the tested local tree exactly. Full regression remains the pushed-head CI verdict.

Prior work and duplicate screening are recorded in the linked issue. This touches CA propagation, so the repository's normal security review gate applies.

@ranxianglei ranxianglei changed the title fix(proxy): apply configured CA trust to both TLS connectors [PR] fix(proxy): apply configured CA trust to both TLS connectors Nov 13, 2026
@ranxianglei
ranxianglei merged commit f9a34c0 into ranxianglei:master Nov 14, 2026
33 of 48 checks passed
@ranxianglei

Copy link
Copy Markdown
Owner

Superseded by #6677 (merged as 3858b6956, 2026-11-14).

Landed into master via the real merge commit f9a34c00c88 (Merge Afloat16/2026-11-13_proxy-ca-trust (PR #6583)), so your original commits are preserved verbatim in master history — only hashes of the batch wrapper changed, your authorship and commit messages are intact.

The fix for #6582 is now in master. Closing this PR as superseded — thanks for the careful, well-tested fix.

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.

Configured CA roots are ignored by proxied TLS connections

2 participants