OpenSSL::SSL::SSLError 当 GCM.send_notification

OpenSSL::SSL::SSLError when GCM.send_notification

我正在使用 GCM gem 向 Android 设备发送推送通知。在生产服务器中,通知发送完美,但是当我尝试在本地发送推送通知时,出现以下错误:

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

请注意,GCM API KEY 设置了与生产服务器相同的密钥,并且我使用与生产服务器相同的 send_notification 参数。我还在 Google Developer Console project credentials(每日更新)中添加了我的本地 IP 地址。

我错过了什么?

注意:使用 RoR v3.2.13Ruby v2.0.0OSx El Capitan,我已经安装了 openssl v1.0.2a-1

好的,问题是我没有安装curl-ca-bundle,像很多类似的问题点。当我尝试用 brew 安装 curl-ca-bundle 时,我发现 package was removed. After a bit of research, I could install the ca-cert on my Mac following this steps.

希望这对以后的人有所帮助。