p / pycurl-archived

pycurl git import (temporary)
GNU Lesser General Public License v2.1
2 stars 6 forks source link

pycurl not working with seting option PROXY_SSLCERT, PROXY_CAINFO and PROXY_SSLKEY #54

Open Nildha opened 7 years ago

Nildha commented 7 years ago

Hello,

Tried using curl and pycurl(code) to connect to a origin server via proxy.

Using CURL Used curl(curl/7.53 libcurl/7.53.0 OpenSSL/1.0.1f zlib/1.2.8) Command given below: curl -x https://proxyserver.com:8445 https://originserver.com -vvvv --proxy-cacert ca.pem --proxy-cert client_certificate.cer --proxy-key client_private.key This give 200 Ok response.

Using Pycurl Tried same scenario with pycurl(PycURL/7.43.0 libcurl/7.53.0 OpenSSL/1.0.1f zlib/1.2.8). Code sample given below:

import pycurl
c = pycurl.Curl()
url = 'https://originserver.com'
proxy = 'https://proxyserver.com:8445'
c.setopt(c.URL, url)
c.setopt(c.PROXY, proxy)
c.setopt(c.PROXY_SSLCERT, 'client_certificate.cer')#Throwing attribute error
c.setopt(c.PROXY_CAINFO, 'ca.pem')
c.setopt(c.PROXY_SSLKEY, 'client_private.key')
c.setopt(c.VERBOSE, True)
c.perform()
c.close()

With this facing error " File "pycurl_client.py", line 7, in c.setopt(c.PROXY_SSLCERT, 'client_certificate.cer') AttributeError: PROXY_SSLCERT". And same issue is faced with all Proxy related SSL parameters.

Any help is appreciated.