Repository navigation
Conversation
maturin uses ureq with the rustls provider. The default ureq root store is the compiled-in webpki-roots list. That list still contains emSign ECC Root CA - G3, so a cacert update does not apply to it. Make `maturin upload` / `maturin publish` (and the OIDC trusted publishing requests) use RootCerts::PlatformVerifier when no MATURIN_CA_BUNDLE / REQUESTS_CA_BUNDLE / CURL_CA_BUNDLE is set. On Linux this reads SSL_CERT_FILE, SSL_CERT_DIR or the system bundle. cargo-xwin already uses the platform verifier for its downloads. See NixOS#576544. Assisted-by: Claude Code (claude-opus-5)
|
You might be interested in seeing this patch I independently came up with: termux/termux-packages@1181d8a. Upstream might also consider accepting this patch considering distros would prefer using OS' certificates |
thunder-coding
added a commit
to thunder-coding/maturin
that referenced
this pull request
Oct 22, 2026
ureq bundles Mozilla's root certificates, and uses it as the default This is especially helpful and needed for distro packagers having to deal with eMudhra like situations. Trusting OS' cert store means distro maintainers can essentially just update the ca-certificates (or equivalent) package and call it a day instead of having to track all packages that bundle their own certificates This patch was earlier hand-written just for the `http_agent()` method, but after finding out that `resolve_pypi_token_via_oidc()` also builds it's own agent, LLM assistance was used to prevent code duplication to extend my original patch's logic to this new function which I earlier missed. The patch was thoroughly reviewed manually for correctness. Patch earlier adopted by Termux in termux/termux-packages@1181d8a Additionally a slightly ugly version of the patch was independently created by a NixOS maintainer in NixOS/nixpkgs#576571
messense
pushed a commit
to PyO3/maturin
that referenced
this pull request
Oct 22, 2026
…h native-tls (#3341) ureq bundles Mozilla's root certificates, and uses it as the default This is especially helpful and needed for distro packagers having to deal with eMudhra like situations. Trusting OS' cert store means distro maintainers can essentially just update the ca-certificates (or equivalent) package and call it a day instead of having to track all packages that bundle their own certificates This patch was earlier hand-written just for the `http_agent()` method, but after finding out that `resolve_pypi_token_via_oidc()` also builds it's own agent, LLM assistance was used to prevent code duplication to extend my original patch's logic to this new function which I earlier missed. The patch was thoroughly reviewed manually for correctness. Patch earlier adopted by Termux in termux/termux-packages@1181d8a Additionally a slightly ugly version of the patch was independently created by a NixOS maintainer in NixOS/nixpkgs#576571
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.
maturin uses ureq with the rustls provider. The default ureq root store is the compiled-in webpki-roots list. That list still contains emSign ECC Root CA - G3, so a cacert update does not apply to it.
Make
maturin upload/maturin publish(and the OIDC trusted publishing requests) use RootCerts::PlatformVerifier when no MATURIN_CA_BUNDLE / REQUESTS_CA_BUNDLE / CURL_CA_BUNDLE is set. On Linux this reads SSL_CERT_FILE, SSL_CERT_DIR or the system bundle. cargo-xwin already uses the platform verifier for its downloads.Tested on x86_64-linux with
maturin upload --repository-url https://test.pypi.org/legacy/and a dummy token: with SSL_CERT_FILE holding one unrelated root, the old build completes TLS and sends the token (403), the new build fails withUnknownIssuerbefore authentication; with the system store and with no SSL_CERT_FILE it reaches the server as before. MATURIN_CA_BUNDLE still overrides. About 39,100 rebuilds (maturinBuildHook), hence staging.Related to: #576485
Related to: #576544
Assisted-by: Claude Code (claude-opus-5)
Things done
./result/bin/.nixpkgs-reviewon this PR. See nixpkgs-review usage.passthru.tests.