'certificate verify failed' when using PyFCM to send a Push Notification

混江龙づ霸主 提交于 2019-12-11 04:13:29

问题


I'm trying to send push notifications via PyFCM (via Firebase Cloud Messaging).

When I tried to do this initially, I got the SNIMMissingWarning telling me that the request to the Firebase server was insecure.

I upgraded packages to handle this, but now I'm stuck with a 'certificate_verify_failed' error.

I went through the PyFCM code and found that it was using the requests module to send a request to the server.

I know that this issue is related to not having the CA certificates for the Firebase server, but have no idea how to get these certificates and setup the requests module to use them.

Can someone help?


回答1:


Found the problem, sharing it for the benefit of others,

Apart from installing requests[security], I needed to install libssl-dev via

sudo apt-get install libssl-dev

So the overall setup for this is, first install the development versions of ffi and ssl libraries:

sudo apt-get install libffi-dev libssl-dev

Then, install requests[security]

pip install requests[security]


来源:https://stackoverflow.com/questions/41074813/certificate-verify-failed-when-using-pyfcm-to-send-a-push-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!