-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Importing urllib3.exceptions.SubjectAltNameWarning fails under 2.0.x #3015
Comments
Hello! And thank you for your report. Sorry that urllib3 2.0 broke your code. The reason the warning disappeared is that in urllib3 2.0 this is no longer a warning but an error: #2113 Can you please share what is your use case for importing the warning? |
I'm trying to fix one of the libraries I'm using: https://github.com/hbldh/pybankid/blob/master/bankid/__init__.py |
Pull request submitted for that library. hbldh/pybankid#48 |
Thanks! Until I see a proper use case for declaring a fake SubjectAltNameWarning in 2.0, I'd like to avoid doing it: if you want your code to work at all under urllib3 2.0, this warning should not fire in 1.26.x. So I think the proper fix is always going to be to fix that warning and then remove the filter. Also note that if you have outdated TLS certificates in your test suite, https://github.com/python-trio/trustme is your friend. :) |
Yes, sorry if my last message was a bit cryptic: I'm not expecting a change to requests, but hopeful that just removing checks for this particular warning in the pybankid library will work for everyone. It works fine for me. |
Subject
from urllib3.exceptions import SubjectAltNameWarning
fails with
under urllib 2.0.2 (also under 2.0.1 and 2.0.0)
Can this exception no longer occur? There is no mention of it in the Changelog or Release descriptions. In addition, searching the repository commits for
SubjectAltNameWarning
doesn't yield any recent changes at all, so I'm stumped why this exception is no longer available, even when it is available under urllib3 1.26.15 with all other installed libraries the same.Environment
Describe your environment.
At least, paste here the output of:
OS Linux-6.2.6-1-pve-x86_64-with-glibc2.29 (Ubuntu 20.04.6 LTS)
Python 3.8.10
urllib3 2.0.2
Steps to Reproduce
As above
Expected Behavior
Import should succeed, as it does under urllib3 1.26.15
Actual Behavior
Import fails with exception as above
The text was updated successfully, but these errors were encountered: