3
votes

I'm having an issue when trying to verify my SSL certificate with Apple Push Notification Services. I followed all the instructions on the iOS developer site (creating the new provisioning profile, creating the new App ID, creating the certificate signing request, downloading the apns .cer file, etc).

Then, following a tutorial online, I converted my .p12 file into a .pem file, and my .cer file to a .pem file, in order to try to verify the certificates.

Here is the request I sent in the terminal:

openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert MyCert.pem -key MyKey.pem

It asked for my passphrase, which I gave it and it accepted. It then returned a lot of stuff with the following blurb at the end:

Verify return code: 20 (unable to get local issuer certificate)

I searched extensively online, and found a few things that seemed relevant, but none of which helped me. I also tried restarting the whole process, and ended up with the same result.

Any help is much appreciated.

2

2 Answers

1
votes

It is due to space you have in your command

openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert PushChatCert.pem -key PushChatKey.pem

instead use

openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert PushChatCert.pem -key PushChatKey.pem

Funny but true and embarassing when you just copy and paste from the site the command..

0
votes

It looks like you didn't trust the root certificate issuing your APNS certificate. To establish a TLS session with APNs, the Entrust Secure CA root certificate must be installed on the provider’s server.

Have a look at the Local and Push Notification Programming Guide for more details.