Skip to content

Add a system-certs-default preview feature#18702

Draft
zanieb wants to merge 11 commits intoastral-sh:mainfrom
zaniebot:claude/system-certs-preview-feature-17Llt
Draft

Add a system-certs-default preview feature#18702
zanieb wants to merge 11 commits intoastral-sh:mainfrom
zaniebot:claude/system-certs-preview-feature-17Llt

Conversation

@zanieb
Copy link
Copy Markdown
Member

@zanieb zanieb commented Mar 24, 2026

No description provided.

claude added 7 commits March 23, 2026 18:48
… by default

When the `system-certs-default` preview feature is enabled, uv defaults to
using system certificates instead of the bundled Mozilla webpki roots. Explicit
CLI flags (`--system-certs` / `--no-system-certs`) and environment variables
still take precedence over the preview default.

https://claude.ai/code/session_01QswG8dVGPRf8iHMWnmYa11
On Linux, rustls-native-certs and openssl-probe discover the system CA
bundle, but it may be absent in minimal environments (e.g., scratch
containers). When system-certs is enabled, merge the bundled Mozilla
roots as extra roots alongside the platform verifier via reqwest's
tls_certs_merge(), which calls Verifier::new_with_extra_roots under
the hood. This ensures basic connectivity even when the system
certificate store is unavailable.

https://claude.ai/code/session_01QswG8dVGPRf8iHMWnmYa11
On macOS and Windows, the platform verifier has a built-in trust store
that always works, so merging extra roots is unnecessary and could
bypass enterprise CA policies. On Linux, the platform verifier falls
back to rustls-native-certs/openssl-probe which read PEM files from
disk — these may be absent in minimal containers. Only merge the
bundled Mozilla roots on Linux where the fallback is actually needed.

https://claude.ai/code/session_01QswG8dVGPRf8iHMWnmYa11
… feature

Update certificates.md to describe the Linux-specific behavior where
bundled Mozilla roots are merged alongside the platform verifier when
the system CA bundle is absent. Add system-certs-default to the list
of available preview features in preview.md.

https://claude.ai/code/session_01QswG8dVGPRf8iHMWnmYa11
Link to the upstream recommendation to augment system certs with
webpki-roots via Verifier::new_with_extra_roots on Linux.

https://claude.ai/code/session_01QswG8dVGPRf8iHMWnmYa11
Remove the `preview` field from `BaseClientBuilder` and
`AuthMiddleware`, and the `Preview` parameter from S3/GCS endpoint
provider functions. All preview feature checks now use the global
`uv_preview::is_enabled()` accessor, which was initialized at startup.

This removes `uv-preview` as a dependency of `uv-client` entirely.

https://claude.ai/code/session_01QswG8dVGPRf8iHMWnmYa11
@zanieb zanieb added the preview Experimental behavior label Mar 24, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 24, 2026

Merging this PR will not alter performance

✅ 5 untouched benchmarks


Comparing zaniebot:claude/system-certs-preview-feature-17Llt (337ff51) with main (dd8bc02)

Open in CodSpeed

zanieb added 4 commits March 24, 2026 14:12
The commit f335a19 changed AuthMiddleware to use the global
uv_preview::is_enabled() instead of threading a Preview value.
However, the middleware unit tests never initialized the global preview
state, causing panics ('The preview configuration has not been
initialized') on all platforms.

Fix by adding uv-preview with the 'testing' feature to dev-dependencies
and calling uv_preview::test::with_features(&[]) in each test.
Same issue as the uv-auth middleware tests: the tests use
RegistryClientBuilder which internally creates an AuthMiddleware
that now calls uv_preview::is_enabled().
Add the same `#[cfg_attr(windows, ignore)]` attribute that all other
show_settings configuration tests use, since the snapshot format for
SystemTime and cache paths differs on Windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants