'证书验证失败'使用PyFCM发送推送通知时 [英] 'certificate verify failed' when using PyFCM to send a Push Notification

查看:34
本文介绍了'证书验证失败'使用PyFCM发送推送通知时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过PyFCM(通过Firebase Cloud Messaging)发送推送通知.

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

最初尝试执行此操作时,我收到SNIMMissingWarning告诉我,对Firebase服务器的请求不安全.

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

我已升级软件包来处理此问题,但现在我遇到了"certificate_verify_failed"错误.

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

我检查了PyFCM代码,发现它正在使用请求模块将请求发送到服务器.

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

我知道此问题与Firebase服务器没有CA证书有关,但不知道如何获取这些证书并设置请求模块以使用它们.

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.

有人可以帮忙吗?

推荐答案

发现了问题,并分享给其他人,

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

除了安装 requests [security] 之外,我还需要通过

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

sudo apt-get install libssl-dev

因此,总体设置是,首先安装ffi和ssl库的开发版本:

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

然后,安装 requests [security]

pip install requests[security]

这篇关于'证书验证失败'使用PyFCM发送推送通知时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆