-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip upgrade ignores locally installed Certificate Authorities #10548
Comments
Note: the CA file:
Must be taken from the system rather than from pip package |
Pip already provide mechanisms to specify a certificate file anywhere on the system: https://pip.pypa.io/en/stable/cli/pip/#cmdoption-cert This can be set with a command argument, or via either a configuration file or environment variable. Are those methods not viable, and why not? |
I'm aware of this. But the problem is that by default system certificate isn't taken which is unexpected behaviour. In many locations systems run behind SSL Inspectors that require having local CA installed. This is normal environment and it is expected not to break environment upon upgrade - since it is something system-wide |
Could you elaborate on this? From my understanding, most third-party web browsers, including Firefox and Google Chrome, for example, use their own CA store by default, not the system store. You may argue pip should have a "use system store" switch (Firefox does IIUC), but doing it by default is by no means a global consensus. |
Not exactly. Firefox is indeed using its own CA store for two reasons (a) they want users explicitly install CA to make sure they understand effects on user - i.e. potential man-in-the-middle. (b) they don't have way to distinguish between original and admin installed CA. AFAIR chrome does use system-wide CA (unless something changed recently) and other browsers and tools (wget/curl and so) |
TBH, this is a wider question than just pip. Your argument applies equally to requests (which is what pip uses to do its HTTP requests) and even further back to core Python. I know there have been discussions about this on the core Python lists, I don't know what requests' position is. But I think you should raise this with them (and pip's position should be "we follow what our HTTP library, currently requests, does"). |
If so the bigger question is why Consider following scenario. I have running system with multiple packages, pip, requests, etc, etc. Now we move it behind SSL Inspection system. Everything is broken and you need to update each and every package manually. BTW pip uses separate CA DB. So basically everything is broken instead of using CA installed by system administrator of the organisation. I mean it has to be at least centralised and not put in each and every possible tool to do whatever it likes: how pip is different from |
The way to make pip use the system certificate store, is to explicitly point pip at it. I’ll add that basically every single corporation that I know of (including multi billion dollar ones) that do use SSL inspection, also tell their users to configure pip to explicitly use the certificate store that they provide. I recommend you do the same. If you don’t want to do that, and instead would like to argue that the default behaviour should be to use the system store, please take that up with the Python standard library and requests, which is effectively where we inherit this from. I’m going to go ahead and close this, because this isn’t something that pip is going to change on its own. You’re going to have to take this up with the wider Python ecosystem, and I wish you best of luck for doing that. |
Description
pip install --upgrade pip
ignores locally installes SSL CAExpected behavior
After upgrade locally installed certificate authorities should be respected
pip version
21.2.4
Python version
3.6
OS
Linux
How to Reproduce
Run behind SSL inspection proxy with cetificate installed
Create venv
Ugrade pip
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: