blee908
blee908

Reputation: 12565

Apple Push Notification / Ruby OpenSSL Error

When trying to send the push notification from my rails application I'm getting this. I made sure the device token and .pem file are valid with the command

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.

Upvotes: 5

Views: 2198

Answers (1)

rubyonrails3
rubyonrails3

Reputation: 259

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. either certificate has been expired or maybe password.

Just update your Apple Push Notification certificate and you should be good.

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.

Hope this help. I fiddle almost a week to sort this issue.

Upvotes: 3

Related Questions