terminal error in between connecting SSL certificate and private key to set up a secure connection:

apple-push-notifications, objective-c, openssl

Solution

The following command is good enough to verify the key/cert:

openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert push_development.pem

The key part is to select both certificate and private key when exporting the .p12 from Keychain Access (you will be asked for 3 passwords, one for the .p12, one for the cert, one for the private key).

To convert .p12 to .pem, follow the instruction from Apple:

openssl pkcs12 -in CertificateName.p12 -out CertificateName.pem -nodes

Problem

i am trying to do push notification in my app and following this link http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12 my system has been successfully connected with telnet but when i enter the query for connecting ssl certificate and private key then found a error ``` $ openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert apns-dev-cert.pem -key apns-dev-key.pem unable to load client certificate private key file 1301:error:0906D06C:PEM routines:PEM_read_bio:no start line:/SourceCache/OpenSSL098/OpenSSL098-44/src/crypto/pem/pem_lib.c:648:Expecting: ANY PRIVATE KEY ``` any one can tell me what type of error and what's the solution of it? Thanks in advance

Original source