mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
PEP 476: enable HTTPS certificate verification by default (#22417)
Patch by Alex Gaynor with some modifications by me.
This commit is contained in:
parent
8cf7c1cff0
commit
4ffb075271
11 changed files with 116 additions and 69 deletions
|
@ -1203,7 +1203,7 @@ else:
|
|||
self.key_file = key_file
|
||||
self.cert_file = cert_file
|
||||
if context is None:
|
||||
context = ssl._create_stdlib_context()
|
||||
context = ssl._create_default_https_context()
|
||||
will_verify = context.verify_mode != ssl.CERT_NONE
|
||||
if check_hostname is None:
|
||||
check_hostname = will_verify
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue