NicosKaralis/pushmeup

APNS.key and APNS.cert

ajbraus opened this issue · 2 comments

Hello,

I'm stuck with the "NoMethodError: undefined method `close' for nil:NilClass" error, which I know is a .pem problem. However I have redone my .pem's 3 times without success.

As a sanity check I tried to connect from the console and it works like this with the key and cert separate.

$ openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert CorideCert.pem -key CorideDevKey.pem

I tried to concatinate these two pem files into one, but that gave the same "closed" error.

$ cat PushChatCert.pem PushChatKey.pem > ck.pem

I also tried "exporting both" from Keychain Access. This creates one .pem file but I still get the undefined method 'close' errror.

What should I do to get these two pem files into one?

On the other hand, wouldn't it just be easier and more explicit to set cert and key attributes separately as two files?

The tutorial http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1 asks for key and cert separate, but you say to "export them together."

Thanks!

I'm getting this error more than 50% of the times, but if I insist and relaunch the script several times it ends up working at some point (without changing anything).

My solution was to:
create explicit app id
enable push notifications
create new provisioning file
install provisioning file in xcode
create certificate request from keychain
submit request and get public and private certificate
download those
export them
translate into .pem file