mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
merge 3.4
This commit is contained in:
commit
074b95da48
1 changed files with 2 additions and 2 deletions
|
@ -146,10 +146,10 @@ def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
|
||||||
)
|
)
|
||||||
if not _have_ssl:
|
if not _have_ssl:
|
||||||
raise ValueError('SSL support not available')
|
raise ValueError('SSL support not available')
|
||||||
context = ssl._create_stdlib_context(cert_reqs=ssl.CERT_REQUIRED,
|
context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
|
||||||
cafile=cafile,
|
cafile=cafile,
|
||||||
capath=capath)
|
capath=capath)
|
||||||
https_handler = HTTPSHandler(context=context, check_hostname=True)
|
https_handler = HTTPSHandler(context=context)
|
||||||
opener = build_opener(https_handler)
|
opener = build_opener(https_handler)
|
||||||
elif context:
|
elif context:
|
||||||
https_handler = HTTPSHandler(context=context)
|
https_handler = HTTPSHandler(context=context)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue