0

I've tried everything I could in an attempt to put some sample data up onto Firebase from a Python script. I'm getting errors that google can't help me with so I'm stuck. This is my code, I sudo piped all the relevant imports and have requests-2.5.1 installed alongside the necessary python-firebase imports.

from firebase import firebase
fb = firebase.FirebaseApplication('https://my-firebase-url.firebaseio.com', None)
result = fb.post('/test',{'temp':'data'})

This returns the following error.

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/firebase/decorators.py", line 19, in wrapped
return f(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/firebase/firebase.py", line 329, in post
connection=connection)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/firebase/decorators.py", line 19, in wrapped
return f(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/firebase/firebase.py", line 97, in make_post_request
timeout=timeout)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 504, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 461, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/Library/Python/2.7/site-packages/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [Errno 1] _ssl.c:499: error:0D0890A1:asn1 encoding     routines:ASN1_verify:unknown message digest algorithm
Tiensi
  • 227
  • 3
  • 11
  • I'm not sure anybody can help you with nothing but an error message. What libs/versions are being used here? It seems likely you're running into an SSL V2 incompatibility, since most of the web has moved on after heartbleed. [Probably this one](http://stackoverflow.com/questions/23002438/ssl-error-occurs-on-one-computer-but-not-the-other)? – Kato Jan 02 '15 at 17:07
  • This is exactly what happened, thanks a ton. I'll update below as to how to fix my error. – Tiensi Jan 03 '15 at 20:53

1 Answers1

2

This was caused due to an out of date SSL. To fix this, I updated my out of date Python (version 2.7) to version 2.7.9.

To check what version your SSL is run the following in the command line: python -c "import ssl; print ssl.OPENSSL_VERSION"

Which will tell you what version of SSL you're using with your Python distribution, mine was OpenSSL 0.9.7l 28 Sep 2006 before the upgrade, and OpenSSL 0.9.8za 5 Jun 2014 after the upgrade.

Tiensi
  • 227
  • 3
  • 11