Daemon start breaks when an app produces SSL error #62

dei79 opened this Issue Aug 12, 2012 · 4 comments

3 participants


When I start the rapns daemon with bundle exec rapns development -f it will be stopped when an application produces an ssl error during certificate and key load:

[2012-08-12 17:37:07] [Sync] Loading app: das
[2012-08-12 17:37:07] [ERROR] OpenSSL::SSL::SSLError, SSL_CTX_use_PrivateKey:: key values mismatch
/Users/dei79/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/bundler/gems/rapns-b3797edc5c27/lib/rapns/daemon/connection.rb:103:in initialize'
/Users/dei79/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/bundler/gems/rapns-b3797edc5c27/lib/rapns/daemon/connection.rb:103:in `connect_socket'

Would be better to ignore this app and add somewhere an error information



In case anyone else has a tough time finding this, the keyword "mismatch" is exactly it. Look in Keychain Access under the Keys tab and you can see the certificates as a child of their private key. Only a matching pair will work.

I might get a chance to look into this one in the next week or so, and submit a patch.

Especially for the case where rapns is used for multiple apps, I think it would be great to not have it shut down just because one certificate isn't configured correctly.


A patch would be great, I'm busy working on support for Google Cloud Messaging (Android).

@mattconnolly mattconnolly added a commit to mattconnolly/rapns that referenced this issue Sep 10, 2012
@mattconnolly mattconnolly Improvements to stop Daemon from exiting when a connection fails (Issue

* AppRunner excludes apps that fail to start
* FeedbackReceiver thread will end cleanly if a connection fails with an SSL error
* Connection logs failed connection attempts as well as successful ones

Hi ileitch, Take a look at my master branch. I also fixed some deprecated rspec expects.

The next commit I just pushed fixes a test that I broke when I moved some logging around.



Please open a pull request.

@ileitch ileitch closed this Sep 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment