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

Detect empty HTTPS contexts. #344

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Conversation

xloem
Copy link

@xloem xloem commented Sep 22, 2024

Some users are relying solely on the certifi package to provide their CA certs, as requests does this by default.

This patch detects this situation and emits a clear warning as well as importing certifi to work around the situation..

Fixes #162 .

Addendum:
If this project is still providing compatibility with Python 2.7, I have not implemented that here at this time.

Addendum 2:
It is also possible the user's OS certificates are not up-to-date. This solution does not detect that scenario. It could be detected by catching the exception mentioned in the linked issue.

Addendum 3:
Regarding requests, this topic has been considered in 2016 at psf/requests#2966 .

It looks like currently the correct solution is to use https://pypi.org/project/truststore/ . I am out of time at the moment to submit new code here.

Some users are relying solely on the certifi package to provide their CA certs, as requests does this by default.

This patch detects this situation and emits a clear warning as well as importing certifi to work around the situation..

Fixes josegonzalez#162 .
@josegonzalez josegonzalez merged commit 22d8f8e into josegonzalez:master Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: 'SSLCertVerificationError' object is not iterable
2 participants