File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 11Changes
22=======
33
4+ 1.25.5 (2019-09-19)
5+ -------------------
6+
7+ * Add mitigation for BPO-37428 affecting Python <3.7.4 and OpenSSL 1.1.1+ which
8+ caused certificate verification to be enabled when using ``cert_reqs=CERT_NONE ``.
9+ (Issue #1682)
10+
11+
4121.25.4 (2019-09-19)
513-------------------
614
Original file line number Diff line number Diff line change 2222
2323__author__ = "Andrey Petrov ([email protected] )" 2424__license__ = "MIT"
25- __version__ = "1.25.4 "
25+ __version__ = "1.25.5 "
2626
2727__all__ = (
2828 "HTTPConnectionPool" ,
Original file line number Diff line number Diff line change 22import errno
33import warnings
44import hmac
5+ import sys
56
67from binascii import hexlify , unhexlify
78from hashlib import md5 , sha1 , sha256
@@ -274,8 +275,12 @@ def create_urllib3_context(
274275 # Enable post-handshake authentication for TLS 1.3, see GH #1634. PHA is
275276 # necessary for conditional client cert authentication with TLS 1.3.
276277 # The attribute is None for OpenSSL <= 1.1.0 or does not exist in older
277- # versions of Python.
278- if getattr (context , "post_handshake_auth" , None ) is not None :
278+ # versions of Python. We only enable on Python 3.7.4+ or if certificate
279+ # verification is enabled to work around Python issue #37428
280+ # See: https://bugs.python.org/issue37428
281+ if (cert_reqs == ssl .CERT_REQUIRED or sys .version_info >= (3 , 7 , 4 )) and getattr (
282+ context , "post_handshake_auth" , None
283+ ) is not None :
279284 context .post_handshake_auth = True
280285
281286 context .verify_mode = cert_reqs
You can’t perform that action at this time.
0 commit comments