Skip to content

Commit dc10fce

Browse files
committed
Set both VERIFYPEER and VERIFYHOST according to the validate_cert setting.
1 parent 6fa950c commit dc10fce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tornado/httpclient.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,12 @@ def _curl_setup_request(curl, request, buffer, headers):
568568
curl.setopt(pycurl.PROXYUSERPWD, credentials)
569569
else:
570570
curl.setopt(pycurl.PROXY, '')
571-
curl.setopt(pycurl.SSL_VERIFYPEER, request.validate_cert)
571+
if request.validate_cert:
572+
curl.setopt(pycurl.SSL_VERIFYPEER, 1)
573+
curl.setopt(pycurl.SSL_VERIFYHOST, 2)
574+
else:
575+
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
576+
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
572577
if request.ca_certs is not None:
573578
curl.setopt(pycurl.CAINFO, request.ca_certs)
574579
else:

0 commit comments

Comments
 (0)