-
Notifications
You must be signed in to change notification settings - Fork 388
feat: allow loading of native certificate store #5013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: allow loading of native certificate store #5013
Conversation
baszalmstra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, how do we deal with this on conda-forge where we use nativetls instead?
Hmm maybe we should remove it for those builds, as this config does not make sense. Wdyt? |
|
maybe we could have a config called |
Co-authored-by: Bas Zalmstra <[email protected]>
|
Excellent suggestion!
…On Mon, Dec 1, 2025 at 10:51 AM Bas Zalmstra ***@***.***> wrote:
*baszalmstra* left a comment (prefix-dev/pixi#5013)
<#5013 (comment)>
maybe we could have a config called tls-certs which is webpki or native.
And we have different defaults based on the selected feature?
—
Reply to this email directly, view it on GitHub
<#5013 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADF4XU7TYND3OFWR3O2C4T37QFQZAVCNFSM6AAAAACNU3W7P2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKOJVGU4TAMZYG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I implemented a version of this @baszalmstra but an open question still remains :) |
| #[serde(rename_all = "lowercase")] | ||
| pub enum TlsRootCerts { | ||
| /// Use bundled Mozilla root certificates | ||
| #[default] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This default depends on which backend is selected through features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the config just doesn't do anything because there is not really an option to select it for native-tls, like the methods to select webkpi are compiled out. So the config is only there in both compilation features as to not break on your config when you switch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crazy
Makes sense to me, we can always change this later. |
|
OP here. I ran |
Would you be able to check if with the version of pixi compiled from this branch you are able to reach your index? :) |
Description
uv allows loading of the system certificate instead of the ones provided by default for rustls. This changes the code to have a
native_certsconfiguration option (global) and CLI options so that one can opt-in to the system store. This all still uses rustls under the hood. This was apparently a much-requested feature for uv. Luckily we can just change the client construction implementation and enable this for both conda and PyPI network requests.I used a different name and construction and deviated from uv here, because we have different requirements. We have both native-tls (conda-forge) builds, and non-native tls. So I added the option for the use to be able to choose, what root certificates to load. For example, when running
pixi install --help, you get:There is also a corresponding
pixi_configglobal setting. That can be set if need be.By default the rustls version uses only "webpki", and the native-tls uses the system store, for rustls you can use "webpki", "native" or "all". For the native-tls version the methods,
tls_built_in_webpki_certsandtls_built_in_native_certsshould not be available, i.e. these are only available for rustls. So we give a warning in this case that these options will be ignored. See: https://docs.rs/reqwest/latest/reqwest/struct.ClientBuilder.html#method.tls_built_in_webpki_certsHowever, and this is a question for @baszalmstra, I feel these will actually be available on our
native-tlsbuild; because ofuvensuring that both features are enabled, as they support only rustls and in the case of a conda-forge build, both features will be on. Not sure what do here but opted to go for the "most correct" approach. wdyt?Fixes #4896
How Has This Been Tested?
I have a script made in
scripts/test_native_cert.pyand corresponding pixi tasks to check if this works. Runpixi r build-releaseandpixi run test-native-certsto verify. This sets up a PyPI registry ngnix docker with a generated CA we add this to the system store to see if we can connect with it.Maybe the OP of the issue could give it a go as well.
AI Disclosure
Tools: Claude Opus 4.5
Checklist:
schema/model.py.