Bitcoin Forum

Bitcoin => Project Development => Topic started by: cytokine on May 15, 2012, 09:29:17 PM



Title: need help with python
Post by: cytokine on May 15, 2012, 09:29:17 PM
What am I doing wrong?
 
    import json, urllib.request, os
    url = 'https://www.glbse.com/api/market/assets'
    if not os.path.exists( 'local' ): os.mkdir( 'local' )
    filename = 'local/assets.glb'
    print( 'Debug> updating %s' % filename )
    response = urllib.request.urlopen( url )
    --> crash

  File "C:\Python32\lib\ssl.py", line 268, in __init__
    raise x
  File "C:\Python32\lib\ssl.py", line 264, in __init__
    self.do_handshake()
  File "C:\Python32\lib\ssl.py", line 443, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [Errno 1] _ssl.c:392: error:1411809D:SSL routines:SSL_CHECK_SERVER
HELLO_TLSEXT:tls invalid ecpointformat list


Title: Re: need help with python
Post by: Nefario on May 15, 2012, 10:02:40 PM
You need to update your openssl library

http://rt.openssl.org/Ticket/Display.html?id=2240&user=guest&pass=guest

Or you could set it so that the certificates authenticity is not checked (this does leave you open to a MITM attack, no biggie if this is just a play script though).


Title: Re: need help with python
Post by: Sukrim on May 15, 2012, 10:05:40 PM
Maybe your python has no SSL support?

I got 0 errors with that code...


Title: Re: need help with python
Post by: cytokine on May 15, 2012, 11:00:54 PM
Maybe your python has no SSL support?

I got 0 errors with that code...

I'm using python 3.2.3, that could be the problem

I think python 2.x urllib does not verify certs by default on SSL


Title: Re: need help with python
Post by: cytokine on May 15, 2012, 11:45:14 PM
Or you could set it so that the certificates authenticity is not checked (this does leave you open to a MITM attack, no biggie if this is just a play script though).

Makes sense, just need to figure out how to do that ( cannot seem to find this documented )

Thanks for the help!


Title: Re: need help with python
Post by: cytokine on May 25, 2012, 08:17:42 PM
So I ended up downgrading to Python 2.x, and bam everything just works.

Thanks