【发布时间】:2016-11-19 07:50:38
【问题描述】:
当我尝试从我的 rails 应用程序发送推送通知时,我得到了这个。我确保设备令牌和 .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'
此错误消息非常模糊,无法弄清楚发生了什么。
【问题讨论】:
-
相关,请参阅“verify error:num=20” when connecting to gateway.sandbox.push.apple.com。您的问题可能与客户端证书有关。证书和私钥怎么都命名为
aps_development.pem? -
如果我通过命令行使用 open openssl,这解决了这个问题,但我使用的是使用 openssl 的 gem(休斯顿),问题仍然存在。有什么想法吗?
-
抱歉,我不了解 Ruby。我很久以前就放弃了。做简单的安全相关任务太难了,比如将协议版本设置为 TLS 1.0 或为 SNI 设置服务器名称。您能否验证您的 Gem 使用的是 TLS 1.0 或更高版本,使用的是服务器名称指示 (SNI),并且使用的是客户端证书?在加密开始之前,Wireshark 将能够分辨出来,因为它们在
ClientHello中可用。 -
我遇到了同样的问题。您确定您的 ruby 使用的是正确版本的 openssl 吗?尝试确定:
ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
标签: ruby-on-rails ruby openssl apn