windows: use Windows store roots for upstream-proxy origin TLS - #268
Open
VIVAAN-DHAWAN wants to merge 1 commit into
Open
windows: use Windows store roots for upstream-proxy origin TLS#268VIVAAN-DHAWAN wants to merge 1 commit into
VIVAAN-DHAWAN wants to merge 1 commit into
Conversation
ProxyConnector::from_proxy builds the CONNECTed origin TLS leg via rustls-native-certs load_native_certs(), which ignores the OS stores when SSL_CERT_FILE/SSL_CERT_DIR are inherited and otherwise only reads CurrentUser\ROOT — so an enterprise user behind HTTPS inspection AND an upstream proxy can still get UnknownIssuer (fkiene#259). On Windows, re-seed the origin TlsConnector with the same windows_root_store() builder the direct path uses (CU + optional LM, serverAuth EKU, time-valid). rustls verification stays on; non-Windows behavior is unchanged. Tests: cargo check (host + no-default-features), clippy --all-targets -D warnings, fmt, taplo, existing proxy_connector_origin_tls_is_active regression, plus a macOS/windows cross-target check where aws-lc-sys C-build tooling was available. Signed-off-by: Vivaan Dhawan <150339722+VIVAAN-DHAWAN@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PR #257 fixed the direct Windows outbound path: native roots from the Windows cert stores, rustls verification kept, inherited
SSL_CERT_FILE/SSL_CERT_DIRignored. TheLLMTRIM_UPSTREAM_PROXYpath was left unchanged.When
LLMTRIM_UPSTREAM_PROXYis set, origin TLS goes throughhyper-http-proxy'sProxyConnector::from_proxywith therustls-tls-native-rootsfeature → hyper-rustlswith_native_roots()→rustls-native-certs::load_native_certs(). That loader:SSL_CERT_FILE/SSL_CERT_DIRwhen either is set (OS store skipped).CurrentUser\ROOT(no LocalMachine).So an enterprise user behind both HTTPS inspection AND an upstream proxy can still get
UnknownIssuer/ Claude Code 529.Fix
On Windows only, re-seed the origin
TlsConnectorwith the samewindows_root_store()builder the direct path uses (set_tlsafterfrom_proxy):SSL_CERT_FILE/SSL_CERT_DIRare ignored on this path too.from_proxyconstruction).Verification
cargo check -p llmtrim(host) andcargo check -p llmtrim --no-default-features --lib(CI variant)cargo clippy -p llmtrim --all-targets -- -D warnings,cargo fmt --all -- --check,taplo fmt --checkproxy_connector_origin_tls_is_activeregression (still guards the construction path)cfg(windows)arm could not be type-checked end-to-end here; the API usage mirrors the already-shippedwindows_native_roots_connector(fix(proxy): trust Windows certificate roots for upstream TLS #257) andset_tls'sOption<tokio_rustls::TlsConnector>signature inhyper-http-proxy1.1.1 (rustls-tls-native-roots→__rustls).Fixes #259