[英]Apple Push Notification / Ruby OpenSSL Error
When trying to send the push notification from my rails application I'm getting this. 当我尝试从我的rails应用程序发送推送通知时,我得到了这个。 I made sure the device token and .pem file are valid with the command
我确保设备令牌和.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'
This error message is incredibly vague, can't figure out what is going on. 此错误消息非常模糊,无法弄清楚发生了什么。
when you get this error OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read finished A: tlsv1 alert internal error
it means there is something wrong with your certificate. 当您收到此错误时
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read finished A: tlsv1 alert internal error
它表示您的证书有问题。 either certificate has been expired or maybe password. 证书已过期或密码。
Just update your Apple Push Notification certificate and you should be good. 只需更新Apple推送通知证书就可以了。
Additional Note: openssl
commands doesn't tell much about it, if you encounter that you need to add -CApath
or -CAfile
( or pass that paths to ENV ) that probably be misleading. 附加说明:如果您遇到需要添加
-CApath
或-CAfile
(或将那些路径传递给ENV)可能会产生误导, openssl
命令并没有说明多少。
Hope this help. 希望这有帮助。 I fiddle almost a week to sort this issue.
我用了差不多一个小时来解决这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.