Firebase - 尝试发布网址时出现SSL错误

时间:2017-10-26 17:28:58

标签: python ssl firebase-realtime-database ubuntu-16.04

我正在尝试向firebase发布帖子请求,但我面临的错误是 相同代码 之前没有发生过的错误。我的互联网连接是通过我的嵌入式Linux(Ubuntu 16.04)设备(Orange Pi 2g物联网)上的2G调制解调器,到目前为止我没有遇到任何问题,在其上运行Python 2.7脚本并发布URL。但是现在突然我在执行代码时遇到了以下错误:

root@OrangePi:~# [ 5218.307887] rc.local[395]: Traceback (most recent call last):
[ 5218.308805] rc.local[395]:   File "/root/TEST/Timekeeper.py", line 38, in <module>
[ 5218.309607] rc.local[395]:     send_event = firebase.post('/device', new_event)
[ 5218.310542] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/firebase/decorators.
[ 5218.311748] rc.local[395]:     return f(*args, **kwargs)
[ 5218.312254] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/firebase/firebase.py
[ 5218.314531] rc.local[395]:     connection=connection)
[ 5218.315074] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/firebase/decorators.
[ 5218.315506] rc.local[395]:     return f(*args, **kwargs)
[ 5218.315895] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/firebase/firebase.py
[ 5218.317208] rc.local[395]:     timeout=timeout)
[ 5218.317692] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/requests-2.18.4-py2.
[ 5218.320210] rc.local[395]:     return self.request('POST', url, data=data, json=json, **kwargs
[ 5218.320780] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/requests-2.18.4-py2.
[ 5218.321206] rc.local[395]:     resp = self.send(prep, **send_kwargs)
[ 5218.322444] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/requests-2.18.4-py2.
[ 5218.324416] rc.local[395]:     r = adapter.send(request, **kwargs)
[ 5218.325043] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/requests-2.18.4-py2.
[ 5218.325572] rc.local[395]:     raise SSLError(e, request=request)
[ 5218.325990] rc.local[395]: requests.exceptions.SSLError: HTTPSConnectionPool(host='hermes-4dc8ror(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),)

生成此错误的代码部分如下:

from firebase import firebase

firebase_url = 'https://hermes-4dc8c.firebaseio.com/'
firebase = firebase.FirebaseApplication(firebase_url, None)

new_event = {

     "eventType": "Sirene"


  }

send_event = firebase.post('/device', new_event)

这款名为Orange Pi 2g IoT的嵌入式设备有自己的调制解调器2G连接到互联网,但我不知道这个东西有什么样的认证,因为它是10美元,Firebase是否有可能因为未知而阻止了我的设备或奇怪的连接起源?有没有人在这之前遇到过这个问题,或者可以帮我解决这个问题?

谢谢,伙计!!

1 个答案:

答案 0 :(得分:0)

这是因为您的互联网速度或火力网的网络连接较低。发生这种情况时,请检查Firebase的status。更多解释here