当尝试从我的 Rails 应用程序发送推送通知时,我得到了这个。我确保设备 token 和 .pem 文件对命令有效
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert aps_development.pem -key aps_development.pem
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read finished A: tlsv1 alert internal error
from /Library/Ruby/Gems/2.0.0/gems/houston-2.2.3/lib/houston/connection.rb:44:in `connect'
from /Library/Ruby/Gems/2.0.0/gems/houston-2.2.3/lib/houston/connection.rb:44:in `open'
from /Library/Ruby/Gems/2.0.0/gems/houston-2.2.3/lib/houston/connection.rb:19:in `open'
from /Library/Ruby/Gems/2.0.0/gems/houston-2.2.3/lib/houston/client.rb:40:in `push'
这个错误信息非常模糊,无法弄清楚发生了什么。
最佳答案
当你得到这个错误 OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read finished A: tlsv1 alert internal error
这意味着你的证书有问题.证书已过期或密码。
只需更新您的 Apple 推送通知证书就可以了。
补充说明:openssl
命令不多说,如果遇到需要添加-CApath
或-CAfile
(或将该路径传递给 ENV )可能会产生误导。
希望对您有所帮助。我花了将近一周的时间来解决这个问题。
关于ruby-on-rails - Apple 推送通知/Ruby OpenSSL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40690498/