From: Gustav Rydstedt Date: Fri, 3 Feb 2012 23:28:31 +0000 (-0800) Subject: Add support for client certificates in curl http client X-Git-Tag: v2.3.0~88^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1157a55a44092bb8f8af00416f74025df8ec0ddb;p=thirdparty%2Ftornado.git Add support for client certificates in curl http client --- diff --git a/tornado/curl_httpclient.py b/tornado/curl_httpclient.py index a338cb8d6..9c100cebc 100644 --- a/tornado/curl_httpclient.py +++ b/tornado/curl_httpclient.py @@ -393,8 +393,11 @@ def _curl_setup_request(curl, request, buffer, headers): curl.unsetopt(pycurl.USERPWD) logging.debug("%s %s", request.method, request.url) - if request.client_key is not None or request.client_cert is not None: - raise ValueError("Client certificate not supported with curl_httpclient") + if request.client_cert is not None: + curl.setopt(pycurl.SSLCERT, request.client_cert) + + if request.client_key is not None: + curl.setopt(pycurl.SSLKEY, request.client_key) if threading.activeCount() > 1: # libcurl/pycurl is not thread-safe by default. When multiple threads