summaryrefslogtreecommitdiffstats
path: root/Lib/http
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-11-23 21:43:47 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-11-23 21:43:47 (GMT)
commit67986f94311ffb46fe5b3efce74d749029041b73 (patch)
tree70aeabba17581022cb3dfcd1c9a59a284a0c1bca /Lib/http
parent32eddc1bbc47479a3639b9191ffc82a52903c5f4 (diff)
downloadcpython-67986f94311ffb46fe5b3efce74d749029041b73.zip
cpython-67986f94311ffb46fe5b3efce74d749029041b73.tar.gz
cpython-67986f94311ffb46fe5b3efce74d749029041b73.tar.bz2
Issue #19735: Implement private function ssl._create_stdlib_context() to
create SSLContext objects in Python's stdlib module. It provides a single configuration point and makes use of SSLContext.load_default_certs().
Diffstat (limited to 'Lib/http')
-rw-r--r--Lib/http/client.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 6e32c7b..5c52ba3 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -1179,9 +1179,7 @@ else:
self.key_file = key_file
self.cert_file = cert_file
if context is None:
- # Some reasonable defaults
- context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
- context.options |= ssl.OP_NO_SSLv2
+ context = ssl._create_stdlib_context()
will_verify = context.verify_mode != ssl.CERT_NONE
if check_hostname is None:
check_hostname = will_verify