Re: curl-and-python Digest, Vol 60, Issue 2

From: Michael Wood <>
Date: Thu, 18 Aug 2011 09:01:19 +0200

On 16 August 2011 17:22, John Skopis <> wrote:
> On 08/16/2011 05:00 AM, wrote:
>>> I am wondering if you know of a better way to initialize setup CAINFO to
>>> >  something useful besides hardcoding the path in do_curl_new. Running
>>> > strings
>>> >  on libcurl reveals the path to CAINFO.
>> libcurl has a default path for CAINFO set internally. If you need to
>> change
>> that then it is entirely up to your app how to do it!
> The app is pycurl. Running the test below fails because CAINFO is set to
> None in pycurl.
> I am wondering what is the best way to initialize pycurl.CAINFO, using the
> library default?
> If you look at the earlier code, I had hardcoded setting the path in the
> pycurl Curl constructor. Rather than hardcoding the path I think it makes
> more sense to ask libcurl for the default path.
> Or, did I compile libcurl incorrectly? Is curl supposed to use the deafult
> if CAINFO/CAPATH is not set?

Your script works fine for me on Ubuntu 10.04:

$ python /tmp/
Testing libcurl/7.19.7 GnuTLS/2.8.5 zlib/ libidn/1.15
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<H1>302 Moved</H1>
The document has moved
<A HREF="">here</A>.

I thought the following might be a workaround for you:


but when I try it here I get:

Traceback (most recent call last):
  File "/tmp/", line 18, in <module>
pycurl.error: (60, 'server certificate verification failed. CAfile:
none CRLfile: none')

Michael Wood <>
Received on 2011-08-18