PEP476: Explicitly mention (and discourage) the ability to monkeypatch, and note the python versions
This commit is contained in:
parent
ad1de7d800
commit
5c4cb9f0eb
10
pep-0476.txt
10
pep-0476.txt
|
@ -26,7 +26,8 @@ will.
|
|||
|
||||
This PEP proposes to enable verification of X509 certificate signatures, as
|
||||
well as hostname verification for Python's HTTP clients by default, subject to
|
||||
opt-out on a per-call basis.
|
||||
opt-out on a per-call basis. This change would be applied to Python 2.7, Python
|
||||
3.4, and Python 3.5.
|
||||
|
||||
Rationale
|
||||
=========
|
||||
|
@ -129,6 +130,13 @@ this by providing the ``context`` argument to ``urllib.urlopen``:
|
|||
context = ssl._create_unverified_context()
|
||||
urllib.urlopen("https://no-valid-cert", context=context)
|
||||
|
||||
It is also possibly **though highly discouraged** to globally disable
|
||||
verification by monkeypatching the ``ssl`` module::
|
||||
|
||||
import ssl
|
||||
|
||||
ssl._create_default_https_context = ssl._create_unverified_context
|
||||
|
||||
Other protocols
|
||||
===============
|
||||
|
||||
|
|
Loading…
Reference in New Issue