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, or follow me on Twitter.

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


Post external references

  1. 1
    https://gist.github.com/shahdhiren/9ca059ac0762f7ef0fcf71a79ed5b022#file-p12topem-txt-L5
Source