]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Add support for client certificates in curl http client 456/head
authorGustav Rydstedt <grydstedt@blizzard.com>
Fri, 3 Feb 2012 23:28:31 +0000 (15:28 -0800)
committerGustav Rydstedt <grydstedt@blizzard.com>
Fri, 3 Feb 2012 23:28:31 +0000 (15:28 -0800)
tornado/curl_httpclient.py

index a338cb8d6603b060945feeb5c08b56c1f5b161f7..9c100cebc980ca390dd05758b99f90f04523fc6e 100644 (file)
@@ -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