Repository navigation
Conversation
pip vendors certifi and adds its cacert.pem to the trust store next to the system store. Every venv made with `python -m venv` gets this pip from ensurepip. Thus a cacert update alone does not remove a distrusted root (for example emSign ECC Root CA - G3) from pip in a venv. Rewrite the bundled pip wheel so that its vendored certifi returns NIX_SSL_CERT_FILE, SSL_CERT_FILE or /etc/ssl/certs/ca-certificates.crt when one exists. The vendored bundle stays as a fallback. The override lives in pkgs/development/interpreters/python/pip-certifi-override.py, so that python3Packages.pip can append the same code to its vendored certifi. Assisted-by: Claude Code (claude-opus-5)
This was referenced Oct 20, 2026
14 of 88 tasks
4 of 13 tasks
dotlambda
reviewed
Oct 28, 2026
dotlambda
left a comment
Member
There was a problem hiding this comment.
Apply https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/certifi/env.patch to the vendored certifi instead. We don't want to maintain the same patch in multiple places.
mBornand
reviewed
Oct 29, 2026
| # Include a sitecustomize.py file | ||
| cp ${../sitecustomize.py} $out/${sitePackages}/sitecustomize.py | ||
| '' | ||
| + optionalString withOpenssl '' |
Contributor
There was a problem hiding this comment.
pip is bundled even in python3Minimal where this is false.
3 of 13 tasks
Contributor
#580722 uses it. |
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.
pip vendors certifi and adds its cacert.pem to the trust store next to the system store. Every venv made with
python -m venvgets this pip from ensurepip. Thus a cacert update alone does not remove a distrusted root (for example emSign ECC Root CA - G3) from pip in a venv.Rewrite the bundled pip wheel so that its vendored certifi returns NIX_SSL_CERT_FILE, SSL_CERT_FILE or /etc/ssl/certs/ca-certificates.crt when one exists. The vendored bundle stays as a fallback.
The override lives in pkgs/development/interpreters/python/pip-certifi-override.py. The python3Packages.pip PR appends the same file to its own vendored certifi: #576525
Tested on x86_64-linux with python3 3.14 (same diff on master): in a venv,
pip download sixwith SSL_CERT_FILE set to an unrelated self-signed cert fails, and with the system bundle it works. Before the change both worked, because pip also trusted its vendored bundle.Related to: #576485
Related to: #576542
Assisted-by: Claude Code (claude-opus-5)
Things done
./result/bin/.nixpkgs-reviewon this PR. See nixpkgs-review usage.passthru.tests.