List Info

Thread: Re: SSL certificates bundle for pycurl?




Re: SSL certificates bundle for pycurl?
country flaguser name
Ukraine
2007-02-15 05:22:32
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>Date: Wed, 14 Feb 2007 10:06:44 +0100 (CET)
>From: Daniel Stenberg <danielhaxx.se>
>Subject: Re: SSL certificates bundle for pycurl?
>To: curl with python <curl-and-pythoncool.haxx.se>
>
>On Wed, 14 Feb 2007, Alexander Belchenko wrote:
>
>> As FAQ says I need CA certificates bundle. Where I
could get this bundle for 
>> Windows?
>
>Try this: http://curl.h
axx.se/docs/caextract.html

I modify script basic_first.py from examples:

#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
# $Id: basicfirst.py,v 1.5 2005/02/11 11:09:11 mfx Exp $

import sys
import pycurl

class Test:
    def __init__(self):
        self.contents = ''

    def body_callback(self, buf):
        self.contents = self.contents + buf

print >>sys.stderr, 'Testing', pycurl.version

t = Test()
c = pycurl.Curl()
c.setopt(c.URL, 'https://launchpad.net/')
c.setopt(c.WRITEFUNCTION, t.body_callback)
c.perform()
c.close()

print t.contents


Then I download file 'cacert.pem' from the URL you
suggested.
I put this file to the directory with my testing script.
But anyway I have the same 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 22, in ?
    c.perform()
pycurl.error: (60, 'SSL certificate problem, verify that the
CA cert is OK. Details:nerror:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
failed')

I rename the file 'cacert.pem' to 'curl-ca-bundle.crt' but
nevertheless error the same.
What I do wrong?

Alexander

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


iD8DBQFF1EJ4zYr338mxwCURApfrAJ0RuPs6cQqu9gNhDpUll6JSFysE5ACe
Nztr
sU2jMo8DxFDjpwnIO0xllN8=
=xZBM
-----END PGP SIGNATURE-----
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-an
d-python

Re: SSL certificates bundle for pycurl?
country flaguser name
Sweden
2007-02-15 08:38:04
On Thu, 15 Feb 2007, Alexander Belchenko wrote:

>> Try this: http://curl.h
axx.se/docs/caextract.html
>
> I modify script basic_first.py from examples:
>
> Then I download file 'cacert.pem' from the URL you
suggested. I put this 
> file to the directory with my testing script. But
anyway I have the same 
> error:

I don't know why you get that. I just tested with the
command line curl and it 
can get that URL fine using the ca-bundle provided with curl
itself, the 
bundle Debian distributes and the one I mentioned on the URL
above...

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-an
d-python

Re: SSL certificates bundle for pycurl?
user name
2007-02-15 12:32:38
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")
"""

regards,
    - kjetil

On 2/15/07, Alexander Belchenko <bialixukr.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> >Date: Wed, 14 Feb 2007 10:06:44 +0100 (CET)
> >From: Daniel Stenberg <danielhaxx.se>
> >Subject: Re: SSL certificates bundle for pycurl?
> >To: curl with python <curl-and-pythoncool.haxx.se>
> >
> >On Wed, 14 Feb 2007, Alexander Belchenko wrote:
> >
> >> As FAQ says I need CA certificates bundle.
Where I could get this bundle for
> >> Windows?
> >
> >Try this: http://curl.h
axx.se/docs/caextract.html
>
> I modify script basic_first.py from examples:
>
> #! /usr/bin/env python
> # -*- coding: iso-8859-1 -*-
> # vi:ts=4:et
> # $Id: basicfirst.py,v 1.5 2005/02/11 11:09:11 mfx Exp
$
>
> import sys
> import pycurl
>
> class Test:
>     def __init__(self):
>         self.contents = ''
>
>     def body_callback(self, buf):
>         self.contents = self.contents + buf
>
> print >>sys.stderr, 'Testing', pycurl.version
>
> t = Test()
> c = pycurl.Curl()
> c.setopt(c.URL, 'https://launchpad.net/')
> c.setopt(c.WRITEFUNCTION, t.body_callback)
> c.perform()
> c.close()
>
> print t.contents
>
>
> Then I download file 'cacert.pem' from the URL you
suggested.
> I put this file to the directory with my testing
script.
> But anyway I have the same 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 22, in ?
>     c.perform()
> pycurl.error: (60, 'SSL certificate problem, verify
that the CA cert is OK. Details:nerror:14090086:SSL
> routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
failed')
>
> I rename the file 'cacert.pem' to 'curl-ca-bundle.crt'
but nevertheless error the same.
> What I do wrong?
>
> Alexander
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

>
>
iD8DBQFF1EJ4zYr338mxwCURApfrAJ0RuPs6cQqu9gNhDpUll6JSFysE5ACe
Nztr
> sU2jMo8DxFDjpwnIO0xllN8=
> =xZBM
> -----END PGP SIGNATURE-----
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-an
d-python
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-an
d-python

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )