Apple Push Notifications converting p12 to pem files

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: lawrence@krubner.com

None of the commands listed on this page worked for me, and yet that is the topped ranked page in Google. What did work for me:

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

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

chmod 0400 apns_key.pem 

chmod 0400 apns_certificates.pem 

openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert apns_certificates.pem -key apns_key.pem

cat apns_certificates.pem apns_key.pem   > Peeroapp.pem
Source