8000 Set VERIFY flags in create_urllib3_context by RichieB2B · Pull Request #3577 · urllib3/urllib3 · GitHub
[go: up one dir, main page]

Skip to content

Set VERIFY flags in create_urllib3_context #3577

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

Merged
merged 4 commits into from
Apr 9, 2025

Conversation

RichieB2B
Copy link
Contributor

Set VERIFY_X509_PARTIAL_CHAIN and VERIFY_X509_STRICT in create_urllib3_context for python 3.13+

fixes #3571

RichieB2B added a commit to RichieB2B/urllib3 that referenced this pull request Mar 29, 2025
@RichieB2B
Copy link
Contributor Author
RichieB2B commented Mar 29, 2025

Note that this change has downstream effects on requests:
https://github.com/urllib3/urllib3/actions/runs/14144861765/job/39630951821

See psf/requests#6924

RichieB2B added a commit to RichieB2B/urllib3 that referenced this pull request Mar 29, 2025
RichieB2B added a commit to RichieB2B/urllib3 that referenced this pull request Mar 29, 2025
RichieB2B added a commit to RichieB2B/urllib3 that referenced this pull request Mar 29, 2025
@pquentin
Copy link
Member

Note that this change has downstream effects on requests: https://github.com/urllib3/urllib3/actions/runs/14144861765/job/39630951821

@sigmavirus24 the certificates introduced in psf/requests#6662 do not pass with VERIFY_X509_STRICT. Would it be possible to fix them? An option is to use trustme (either at runtime or in the Makefile), there's prior art in https://github.com/psf/requests/blob/1764cc938efc3cc9720188dfa6c3852c45211aa0/tests/conftest.py#L37-L46

@RichieB2B RichieB2B requested a review from illia-v April 1, 2025 19:17
@illia-v
Copy link
Member
illia-v commented Apr 8, 2025

@pquentin +1 for using trustme for the certificate!

I added a patch from psf/requests#6924 for now to fix the downstream test.

@illia-v illia-v merged commit 75709c1 into urllib3:main Apr 9, 2025
32 of 34 checks passed
@illia-v
Copy link
Member
illia-v commented Apr 9, 2025

@RichieB2B @Rogdham thanks for working on this!

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.

create_urllib3_context() should set ssl.VERIFY_X509_PARTIAL_CHAIN and ssl.VERIFY_X509_STRICT
4 participants
0