fix: use platform-native TLS for binary downloads to support corporate proxies#929
Open
aquilacf wants to merge 1 commit intocloudflare:mainfrom
Open
fix: use platform-native TLS for binary downloads to support corporate proxies#929aquilacf wants to merge 1 commit intocloudflare:mainfrom
aquilacf wants to merge 1 commit intocloudflare:mainfrom
Conversation
…dependency, enabling macOS SecureTransport (and platform-native TLS on other OSes). worker-build/src/binary.rs -- Replaces the default ureq::get(url) call (which uses rustls with a static webpki-roots CA bundle) with a custom Agent configured to use TlsProvider::NativeTls + RootCerts::PlatformVerifier. This delegates certificate verification to the OS, which trusts any CAs in the system keychain -- including corporate proxy CAs like Netskope.
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.
Binary downloads (wasm-bindgen, esbuild, wasm-opt) fail with
invalid peer certificate: UnknownIssuerin environments where HTTPS traffic is intercepted by a corporate security proxy (e.g. Netskope).The root cause is that
ureqdefaults torustlswithwebpki-roots, a static bundle of Mozilla root CAs compiled into the binary. When a corporate proxy re-signs TLS certificates with its own CA (installed in the OS keychain but absent from the Mozilla bundle),rustlsrejects the certificate chain.Changes
native-tlsfeature to theureqdependency inworker-build/Cargo.tomldownload()function inbinary.rsto create aureq::Agentconfigured withTlsProvider::NativeTlsandRootCerts::PlatformVerifier, delegating certificate verification to the OS (SecureTransport on macOS, SChannel on Windows, OpenSSL on Linux)This ensures downloads respect the system certificate store, including any corporate or custom root CAs, while remaining transparent to users not behind a proxy.
Fixes #928