curl-and-python
Re: SSL certificates bundle for pycurl? (Kjetil Jacobsen)
Date: Fri, 16 Feb 2007 18:56:52 +0100
hi,
perhaps you need to set the certificate type then. have you looked at
the various curl options for this, for instance SSLCERTTYPE?
there's a lot of information at
http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
all of these options can be used in pycurl (just remove CURLOPT_ from
the constant and you have the corresponding pycurl option).
- kjetil
On 2/16/07, Alexander Belchenko <bialix_at_ukr.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Date: Thu, 15 Feb 2007 19:32:38 +0100
> From: "Kjetil Jacobsen" <kjetilja_at_gmail.com>
> Subject: Re: SSL certificates bundle for pycurl?
> To: "curl with python" <curl-and-python_at_cool.haxx.se>
>
> >hi,
>
> >i'm no wiz at the subject, but the code you provide does not seem to
> >set any SSL options.
> >try using the SSLCERT option to set the file location like this:
> >"""
> >c.setopt(c.SSLCERT, "/path/to/cert/file")
> >"""
>
> After I add the line you suggested I have another error:
>
> Testing libcurl/7.15.5 OpenSSL/0.9.8c zlib/1.2.3 c-ares/1.3.1
> Traceback (most recent call last):
> File "launchpad.py", line 23, in ?
> c.perform()
> pycurl.error: (58, "unable to set private key file: 'cacert.pem' type
> PEM\n")
>
> My script now looks like:
>
> t = Test()
> c = pycurl.Curl()
> c.setopt(c.URL, 'https://launchpad.net')
> c.setopt(c.WRITEFUNCTION, t.body_callback)
> c.setopt(c.SSLCERT, "cacert.pem")
> c.perform()
> c.close()
>
>
> - --
> Alexander
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFF1eG0zYr338mxwCURAoR6AJ4p7LT0Jha7uhJ7UFtbDAn3lJ4OtgCfa/+r
> Gm+1FtVZ7H9uLtPQ00naCL8=
> =qiHd
> -----END PGP SIGNATURE-----
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2007-02-16