summaryrefslogtreecommitdiffstats
path: root/Lib/http/client.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-12-07 18:47:34 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-12-07 18:47:34 (GMT)
commitb46247bee518487abcc9e17925d28d682b8e08ac (patch)
tree6618e2002d1aa6a6abd6f51626235a866e9a8bfc /Lib/http/client.py
parent5db1bb81ff88c90364cfcf458bae8115126411d8 (diff)
parenta090f01bb63d73382e6e65b0364047c50afae5c2 (diff)
downloadcpython-b46247bee518487abcc9e17925d28d682b8e08ac.zip
cpython-b46247bee518487abcc9e17925d28d682b8e08ac.tar.gz
cpython-b46247bee518487abcc9e17925d28d682b8e08ac.tar.bz2
merge 3.4 (#22959)
Diffstat (limited to 'Lib/http/client.py')
-rw-r--r--Lib/http/client.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 4a8b4ee..4169e60 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -1274,8 +1274,8 @@ else:
context = ssl._create_default_https_context()
will_verify = context.verify_mode != ssl.CERT_NONE
if check_hostname is None:
- check_hostname = will_verify
- elif check_hostname and not will_verify:
+ check_hostname = context.check_hostname
+ if check_hostname and not will_verify:
raise ValueError("check_hostname needs a SSL context with "
"either CERT_OPTIONAL or CERT_REQUIRED")
if key_file or cert_file: