Skip to content
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

Documentation Update: Specify where to get a .PEM file for --cert option #11574

Open
1 task done
hardingprofessional opened this issue Nov 4, 2022 · 10 comments
Open
1 task done
Labels
good first issue A good item for first time contributors to work on type: docs Documentation related type: feature request Request for a new feature

Comments

@hardingprofessional
Copy link

hardingprofessional commented Nov 4, 2022

What's the problem this feature will solve?

When building old versions of Python (3.7, 3.8, 3.9) the bundled pip3 version does not have the correct bundled certificates to get packages or updates from Pypi.org.

If you search the web, the recommended solution is to acquire the Mozilla certificate bundle from a third party and pass it in as an argument to python3 -m pip install --upgrade --cert=path/to/cert.pem. This is bad security practice. More details here..

There are many people complaining about SSL, want to disable it, etc. This would all be a lot less painful if the pip documents simply provided a root store that could be downloaded and used.

I'm not a security guy, and I don't know what all is involved, but if we need a .pem file to upgrade old versions of pip... shouldn't that be provided by pypi or pip through their website?

Describe the solution you'd like

Embed instructions on how to obtain a cert for the --cert flag in the documentation here: Using a specific certificate store

Potentially add a link to this cert file in other locations.

This cert file would contain only the components needed to upgrade pip to its latest version. Subsequent use of pip could then use the cert information embedded in pip itself.

Alternative Solutions

The pip team could work with the python team to backport the pip certs into the older builds of python available through python.org.

Solutions that bypass TLS/SSL security should not be used for these reasons:

  • Less secure
  • These "workarounds" tend to get deprecated frequently
  • These "workarounds" will be rejected by sharp security teams

Additional context

Code of Conduct

@hardingprofessional hardingprofessional added S: needs triage Issues/PRs that need to be triaged type: feature request Request for a new feature labels Nov 4, 2022
@uranusjr uranusjr added type: docs Documentation related good first issue A good item for first time contributors to work on and removed S: needs triage Issues/PRs that need to be triaged labels Nov 4, 2022
@uranusjr
Copy link
Member

uranusjr commented Nov 4, 2022

The pip team could work with the python team to backport the pip certs into the older builds of python available through python.org.

I don’t think we’ll go very far with that, the maintenance overhead for the Python team would be simply too large.

@pfmoore
Copy link
Member

pfmoore commented Nov 4, 2022

Im also uncomfortable with the idea of the pip team being responsible for distributing security certificates (or even directing people to specific ones). We don’t have the security expertise or bandwidth for that.

@hardingprofessional
Copy link
Author

The pip team could work with the python team to backport the pip certs into the older builds of python available through python.org.

I don’t think we’ll go very far with that, the maintenance overhead for the Python team would be simply too large.

Is there a good way to source build pip and merge it i to the python build tree?

I'm imagining something like this:

  1. Get source for python, configure, make, make install
  2. Get source for pip, configure, make, make install
  3. If (2) doesn't merge into python, then sudo rsync path1 path2 to override the old pip with the new one.

@pfmoore
Copy link
Member

pfmoore commented Nov 4, 2022

Python <=3.9 are in security fix only mode, so newer releases of pip aren't included, but you could probably find the PRs to upgrade the bundled pip for later Python versions and backport them into your older Python source tree. That's likely to be the most practical solution.

@hardingprofessional
Copy link
Author

OK, that solution works for me I guess. I find it a bit concerning that people are using random cert bundles from around the web, but if that's not something you want to support then bypassing TLS/SSL is probably the next best option for people.

@pfmoore
Copy link
Member

pfmoore commented Nov 4, 2022

I find it a bit concerning that people are using random cert bundles from around the web

I do too, but there's not much we can do about it if people won't get certs from a reputable source...

bypassing TLS/SSL is probably the next best option for people

That's absolutely not a good option.

Apart from the fact that bad advice seems endemic on the internet, along with people willing to follow it, why isn't "get a trusted cert bundle and use it via --cert" the correct option for people hitting this issue?

@hardingprofessional
Copy link
Author

The simple answer to this is "reputable certs are hard to find and harder for laymen to identify." That's why I made this ticket.

@pfmoore
Copy link
Member

pfmoore commented Nov 4, 2022

Fair enough. But in this context, the pip maintainers probably count as laymen, too, so you shouldn't trust us to find reputable certs for people 🙂

@Kaushik-Iyer
Copy link

Should I try to work on this?

@uranusjr
Copy link
Member

uranusjr commented Jan 4, 2023

Sure, feel free.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good item for first time contributors to work on type: docs Documentation related type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

4 participants