Skip to content

fix(media): trust the system certificate store for S3 endpoints - #10066

Open
zhenzhongxu wants to merge 1 commit into
block:mainfrom
zhenzhongxu:fix/s3-client-system-trust-store
Open

zhenzhongxu wants to merge 1 commit into
block:mainfrom
zhenzhongxu:fix/s3-client-system-trust-store

Conversation

@zhenzhongxu

@zhenzhongxu zhenzhongxu commented Dec 1, 2026 •

Copy link
Copy Markdown

Summary

The relay cannot verify an S3-compatible endpoint whose certificate is issued by a private CA (#10065). rust-s3's tokio-rustls-tls selects reqwest 0.12's rustls-tls, which trusts only the bundled webpki roots, so the S3 client ignores the system trust store and SSL_CERT_FILE.

This enables rustls-tls-native-roots on that same reqwest through a renamed dependency in buzz-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 on buzz-media, so one declaration reaches the relay and buzz-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 storageAccounting and deletionDrain chart jobs cannot be given a CA, and the aws-creds credential 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:

Build SSL_CERT_FILE Result
with change the CA git object-store backend admitted: A3 conformance probe passed, relay listens
with change unset refused (error sending request)
with change an unrelated CA refused
without change the CA refused
  • The table is from builds of this branch's commit and of unmodified main. An earlier run against a second S3 server implementation gave the same results (that run was one commit behind on main; the intervening commit touched no Rust code and the binaries are byte-identical).
  • cargo tree -e features -i reqwest@0.12.28 -p buzz-relay shows rustls-tls-native-roots with the change and not without; cargo metadata --locked passes for both lock files.
  • The commands behind just fmt-check and just 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 unmodified main, so not from this change.

Not done: the rest of just ci (the full test-unit recipe, 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 that SSL_CERT_FILE replaces the system store comes from reading rustls-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

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>
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 79beb12fa90cd8f5cdbdbbba1946690b432b74f1...aed7870d974456d73e3ddc0d2a2a1ced21b3448e.
A new review must complete for this exact range. When manual authorization
is required, a user with write access must comment exactly
@buzz-security-review aed7870d974456d73e3ddc0d2a2a1ced21b3448e to authorize a new review.
Any previous review applies only to its recorded range.

@zhenzhongxu
zhenzhongxu marked this pull request as ready for review December 1, 2026 08:49
@zhenzhongxu
zhenzhongxu requested a review from a team as a code owner December 1, 2026 08:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T08:53:42.069866Z aed7870 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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

No deployments
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.

Relay cannot verify an S3 endpoint behind a private CA (S3 client ignores the system trust store and SSL_CERT_FILE)

1 participant