diff --git a/Lib/ssl.py b/Lib/ssl.py index 3c0361330d7e951..db66c59c05cc542 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -757,8 +757,6 @@ def _create_unverified_context(protocol=None, *, cert_reqs=CERT_NONE, context.check_hostname = check_hostname if cert_reqs is not None: context.verify_mode = cert_reqs - if check_hostname: - context.check_hostname = True if keyfile and not certfile: raise ValueError("certfile must be specified")