curl-and-python

Setting CURLOPT_PROXY_CAINFO/CURLOPT_PROXY_CAPATH

From: Arshad Khan via curl-and-python <curl-and-python_at_cool.haxx.se>
Date: Thu, 21 Sep 2017 11:47:49 +0800

Hello All

I am using PyCurl 7.43/libcurll 7.52.1 (PycURL/7.43.0 libcurl/7.52.1
OpenSSL/1.0.2j zlib/1.2.3 c-ares/1.10.0).

I am trying to use https to connect to a proxy which then connects to a
server using https. From curl command line I can successfully establish an
end-to-end connection by setting the proxy-cacert property. Now I want to
do the same from pycurl. As of 7.52, curl supports https proxy and the
options CURLOPT_PROXY_CAPATH/CURLOPT_PROXY_CAINFO. Since pycurl doesn't
contain these options, I use the setopt_string to set these options (10246,
10247). However, in both cases I get the 'TypeError: strings are not
supported for this option' message. Any idea what could be the problem?
Here is a snippet of my code:

c=pycurl.Curl()
c.setopt(pycurl.URL, str('https://<server url>'))
c.setopt(pycurl.PROXY, 'https://<proxy server url>')
c.setopt(pycurl.PROXYPORT, 5000)
c.setopt_string(10246, str('/my/home/certs/cacert.pem')) #
CURLOPT_PROXY_CAINFO = 10000 + 246

Any help is greatly appreciated.

Thanks
Arshad

_______________________________________________
https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2017-09-21