nomad-cli / houston

Apple Push Notifications; No Dirigible Required
http://nomad-cli.com
MIT License
2.93k stars 229 forks source link

Feedback Service fails - Houston::Client.development.devices fails #126

Closed jdraths closed 7 years ago

jdraths commented 7 years ago

running

Houston::Client.development.devices

fails for some reason. This has worked in the past with no issue. The returned error is:

TypeError: no implicit conversion of nil into String
from /usr/local/rvm/gems/ruby-2.3.0/gems/houston-2.2.3/lib/houston/connection.rb:39:in `initialize'
from /usr/local/rvm/gems/ruby-2.3.0/gems/houston-2.2.3/lib/houston/connection.rb:39:in `new'
from /usr/local/rvm/gems/ruby-2.3.0/gems/houston-2.2.3/lib/houston/connection.rb:39:in `open'
from /usr/local/rvm/gems/ruby-2.3.0/gems/houston-2.2.3/lib/houston/connection.rb:19:in `open'
jdraths commented 7 years ago

Also getting this error today:

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read finished A: sslv3 alert certificate unknown
/usr/local/rvm/gems/ruby-2.3.0/gems/houston-2.2.3/lib/houston/connection.rb:44:in `connect'

which I would think is related since they are both failing in this block of code:

def open
  return false if open?

  @socket = TCPSocket.new(@uri.host, @uri.port)

  context = OpenSSL::SSL::SSLContext.new
### LINE 39 BELOW
  context.key = OpenSSL::PKey::RSA.new(@certificate, @passphrase)
  context.cert = OpenSSL::X509::Certificate.new(@certificate)

  @ssl = OpenSSL::SSL::SSLSocket.new(@socket, context)
  @ssl.sync = true
### LINE 44 BELOW
  @ssl.connect
end
jdraths commented 7 years ago

I updated openssl and regenerated my certificates today even though they weren't expired in Developer Member Center and the problem disappeared.

nbastoWM commented 7 years ago

Hi. I'm using this gem and I'm getting this same error. I regenerated the certificate, toggledbetween production and development, the notification is sent but when I try to get feedback I get:

TypeError (no implicit conversion of nil into String):
  houston (2.2.3) lib/houston/connection.rb:39:in `initialize'
  houston (2.2.3) lib/houston/connection.rb:39:in `new'
  houston (2.2.3) lib/houston/connection.rb:39:in `open'
  houston (2.2.3) lib/houston/connection.rb:19:in `open'
dankimio commented 7 years ago

Which version of OpenSSL and Ruby are you using? Can you try the same with the latest Ruby version?

nbastoWM commented 7 years ago

I tried with different Certificates, and Ruby 2.1.5 and 2.3.3.

nbastoWM commented 7 years ago

OK, I don't know why, but I assigned the service to a variable and now it is OK:

apn = Houston::Client.production
unregisteredDevices = apn.devices