Fix last place that allowed a missing check_hostname
MODIFY
src/urllib3/connection.py
src/urllib3/connection.py
@@ -413,7 +413,7 @@ class HTTPSConnection(HTTPConnection):
)
elif (
context.verify_mode != ssl.CERT_NONE
- and not getattr(context, "check_hostname", False)
+ and not context.check_hostname
and self.assert_hostname is not False
):
# While urllib3 attempts to always turn off hostname matching from

Fix last place that allowed a missing check_hostname