Skip to content

fix: keep OS trust store for native-tls System mode#6235

Merged
ruben-arts merged 5 commits into
prefix-dev:mainfrom
baszalmstra:claude/gifted-rubin-FpqeK
May 29, 2026
Merged

fix: keep OS trust store for native-tls System mode#6235
ruben-arts merged 5 commits into
prefix-dev:mainfrom
baszalmstra:claude/gifted-rubin-FpqeK

Conversation

@baszalmstra
Copy link
Copy Markdown
Contributor

@baszalmstra baszalmstra commented May 28, 2026

Description

Fixes certificate validation failures introduced in 0.68.1 for users on native-tls builds in corporate environments (custom proxy or enterprise CAs). Such setups were failing with "unable to find any user-specified roots in the final cert chain" when resolving PyPI and conda dependencies.

With this change, native-tls builds again trust the operating system's certificate store by default, so enterprise and proxy CAs that the OS already trusts work without extra configuration. Custom certificates from SSL_CERT_FILE / SSL_CERT_DIR continue to be honored on top of the OS store.

Fixes #6229

How Has This Been Tested?

Verified that both the native-tls and default rustls builds compile.
A reporter on a Windows corporate network with a custom native-tls build should confirm that pixi can again resolve PyPI dependencies (e.g. pixi lock) without certificate errors.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

claude added 3 commits May 28, 2026 13:06
Using `tls_certs_only` on the native-tls backend sets
`disable_built_in_roots(true)`, which discards the OS trust evaluation
and forces the chain the OS built to terminate at one of the certs
snapshotted via `rustls_native_certs`. In corporate environments the OS
trusts enterprise/proxy CAs that `rustls_native_certs` does not
enumerate, so verification failed with "unable to find any user-specified
roots in the final cert chain".

`tls_certs_only` is correct for rustls (which has no OS-level trust) but
wrong for native-tls. For native-tls `System` mode we now keep the OS
trust store and only merge extra roots from `SSL_CERT_FILE`/`SSL_CERT_DIR`.

https://claude.ai/code/session_01KgmnaNpU7eK8FNoXc8m2yd
Extract the native-tls root-cert decision into a pure `native_tls_trust`
mapping so the prefix-dev#6229 regression is unit-testable (reqwest's builder is
opaque about disable_built_in_roots). Assert System / LegacyNative / All
keep the OS trust store and only Webpki replaces it.

https://claude.ai/code/session_01KgmnaNpU7eK8FNoXc8m2yd
Remove the NativeTlsTrust enum, native_tls_trust mapping, and its unit
tests. reqwest's builder is opaque so the mapping test added little; uv
ships no cert tests either. Inline the native-tls root logic and tighten
the comments.

https://claude.ai/code/session_01KgmnaNpU7eK8FNoXc8m2yd
claude added 2 commits May 29, 2026 05:46
The import is only used inside the native-tls/rustls cfg blocks, so it
triggered an unused-import error when pixi_utils is built without either
feature (e.g. the docs generator).

https://claude.ai/code/session_01KgmnaNpU7eK8FNoXc8m2yd
@ruben-arts ruben-arts merged commit 8c077eb into prefix-dev:main May 29, 2026
37 checks passed
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.

pixi certificate problems in version 0.68.1 and higher

3 participants