ruby – 尝试连接Apple推送通知服务时,为什么会出现OpenSSL错误
发布时间:2020-12-17 02:25:10 所属栏目:百科 来源:网络整理
导读:也许还有其他问题可以解决,但我似乎无法解决我的问题. 我正在尝试使用Apple推送通知服务作为提供者,使用ruby 2.2.3. 我尝试了一系列我发现的宝石,它们都有同样的问题.我尝试过的宝石是: grocer apns houston 他们都提出了同样的例外: OpenSSL::SSL::SSLErr
也许还有其他问题可以解决,但我似乎无法解决我的问题.
我正在尝试使用Apple推送通知服务作为提供者,使用ruby 2.2.3. 我尝试了一系列我发现的宝石,它们都有同样的问题.我尝试过的宝石是: > grocer 他们都提出了同样的例外: OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server session ticket A 这些宝石正在使用OpenSSL创建到APNS端点的SSL连接.但他们没有做到这一点. 请注意,我正在使用Mac OS X Yosemite机器. 有帮助吗? 编辑有关我如何使用杂货店的更多信息: pusher = Grocer.pusher( certificate: "/Users/panayotismatsinopoulos/Documents/ProgrammingSwift/certificate.pem",passphrase: "the passphrase for loading certificate",gateway: "gateway.sandbox.push.apple.com",port: 2195,retries: 3 ) notification = Grocer::Notification.new( device_token: "....the device token here...",alert: "Hello There!",badge: 42) pusher.push(notification) 我得到的例外是: OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server session ticket A from /Users/panayotismatsinopoulos/.rvm/gems/ruby-2.2.3@my_project/gems/grocer-0.6.1/lib/grocer/ssl_connection.rb:43:in `connect' from /Users/panayotismatsinopoulos/.rvm/gems/ruby-2.2.3@my_project/gems/grocer-0.6.1/lib/grocer/ssl_connection.rb:43:in `connect' from /Users/panayotismatsinopoulos/.rvm/gems/ruby-2.2.3@my_project/gems/grocer-0.6.1/lib/grocer/connection.rb:29:in `connect' from /Users/panayotismatsinopoulos/.rvm/gems/ruby-2.2.3@my_project/gems/grocer-0.6.1/lib/grocer/connection.rb:55:in `with_connection' from /Users/panayotismatsinopoulos/.rvm/gems/ruby-2.2.3@my_project/gems/grocer-0.6.1/lib/grocer/connection.rb:23:in `write' from /Users/panayotismatsinopoulos/.rvm/gems/ruby-2.2.3@my_project/gems/grocer-0.6.1/lib/grocer/pusher.rb:8:in `push' from (irb):29 from /Users/panayotismatsinopoulos/.rvm/gems/ruby-2.2.3@my_project/gems/railties-4.2.4/lib/rails/commands/console.rb:110:in `start' from /Users/panayotismatsinopoulos/.rvm/gems/ruby-2.2.3@my_project/gems/railties-4.2.4/lib/rails/commands/console.rb:9:in `start' from /Users/panayotismatsinopoulos/.rvm/gems/ruby-2.2.3@my_project/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:68:in `console' from /Users/panayotismatsinopoulos/.rvm/gems/ruby-2.2.3@my_project/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!' from /Users/panayotismatsinopoulos/.rvm/gems/ruby-2.2.3@my_project/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>' from bin/rails:4:in `require' from bin/rails:4:in `<main>' 解决方法
最后,我意识到我使用了错误的.pem文件.这不是我试图将通知推送到移动应用程序的具体内容.
这是与签名证书相对应的.pem文件,用于签署我的代码. 一旦我使用了正确的.pem文件,一切都顺利进行. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |