'certificate verify failed' when using PyF

2019-07-26 06:05发布

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条回答
淡お忘
2楼-- · 2019-07-26 06:48

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]
查看更多
登录 后发表回答