Repository navigation
fix(media): trust the system certificate store for S3 endpoints - #10066
Open
zhenzhongxu wants to merge 1 commit into
Open
zhenzhongxu wants to merge 1 commit into
zhenzhongxu wants to merge 1 commit into
Conversation
rust-s3's `tokio-rustls-tls` feature selects reqwest 0.12's `rustls-tls`, which trusts only the compiled-in webpki roots. The S3 client therefore ignores the system trust store and SSL_CERT_FILE, and an S3-compatible endpoint behind a private CA cannot be verified. Enable `rustls-tls-native-roots` on that same reqwest through a renamed dependency in buzz-media (Cargo feature unification), so the S3 client loads native roots in addition to the bundled ones. Certificate and hostname verification are unchanged. No new crates enter either lock file. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Zhenzhong Xu <2775108+zhenzhongxu@users.noreply.github.com>
🔐 Codex Security Review
|
zhenzhongxu
marked this pull request as ready for review
December 1, 2026 08:49
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
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.
Summary
The relay cannot verify an S3-compatible endpoint whose certificate is issued by a private CA (#10065).
rust-s3'stokio-rustls-tlsselects reqwest 0.12'srustls-tls, which trusts only the bundled webpki roots, so the S3 client ignores the system trust store andSSL_CERT_FILE.This enables
rustls-tls-native-rootson that same reqwest through a renamed dependency inbuzz-media(Cargo feature unification). The S3 client then loads native roots in addition to the bundled ones. Certificate and hostname verification are unchanged. No new crates enter either lock file; every S3 user in the workspace depends onbuzz-media, so one declaration reaches the relay andbuzz-admin.Also adds a note to the chart's S3 section on supplying a CA bundle to the relay.
rust-s3 0.38.0 has no native-roots feature and no way to inject a client, so a version bump would not fix this. The alternatives I considered were
tokio-native-tls(adds OpenSSL) and patching rust-s3; both are larger.Not addressed here (listed in #10065): the
storageAccountinganddeletionDrainchart jobs cannot be given a CA, and theaws-credscredential fetch.Related issue
Fixes #10065. No earlier issue or PR about S3 found; #5197 and #7388 are the same class of problem for client WebSockets.
Testing
Built
buzz-relay(debug profile, pinned toolchain) with and without the change and ran each against an S3-compatible server over HTTPS with a certificate from a throwaway private CA:SSL_CERT_FILEgit object-store backend admitted: A3 conformance probe passed, relay listenserror sending request)main. An earlier run against a second S3 server implementation gave the same results (that run was one commit behind onmain; the intervening commit touched no Rust code and the binaries are byte-identical).cargo tree -e features -i reqwest@0.12.28 -p buzz-relayshowsrustls-tls-native-rootswith the change and not without;cargo metadata --lockedpasses for both lock files.just fmt-checkandjust clippy(cargo fmt --all -- --check;cargo clippy --workspace --all-targets -- -D warnings) pass, run in a Linux container.cargo test -p buzz-media --lib: 170 passed, 4 ignored.cargo-deny check(0.22.2): bans, licenses and sources ok. Advisories fails on RUSTSEC-2026-0253 and RUSTSEC-2026-0386, identically on unmodifiedmain, so not from this change.Not done: the rest of
just ci(the fulltest-unitrecipe, and the desktop, web and mobile jobs, none of which this touches), a release-profile build or the project's image, a media upload through the relay API (only the startup probe exercised S3), and a regression test. The existing MinIO tests use plain HTTP; a TLS lane would need certificate fixtures, which seemed out of proportion for a one-line dependency change. The chart note's statement thatSSL_CERT_FILEreplaces the system store comes from readingrustls-native-certs, not from a test.All of the above was run by an agent. I then ran the four relay cases in the table myself, on the builds of this commit and of unmodified
main, and saw the same results.buzz-review-completed
🤖 Generated with Claude Code