Why am I getting an OpenSSL error when trying to connect to the Apple Push Notification Service?

There may be other questions to this question, but I cannot solve my problem.

I am trying to use the Apple Push notification service as a provider using ruby ​​2.2.3.

I tried a series of gems that I found, and they all have the same problem. Gemstones I tried:

All of them raise the same exception:

OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server session ticket A

These stones use OpenSSL to create an SSL connection to the APNS endpoint. But they do not.

Please note that I am working on a Mac OS X Yosemite machine.

Any help?

EDIT Further information on how I use grocer:

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)

And I get the following:

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>'
+4
1

, , .pem. , , . .pem, .

.pem, .

+3

Source: https://habr.com/ru/post/1614121/


All Articles