Why don’t any articles about Apple Push Notifications agree about what commands to use?

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

Apparently there are a lot of ways to do this? I am suspicious, because I lost days trying to get this to work.

This article says:

Now we need to encode these two files in Base64:

openssl base64 -in cert.pem -out cert.txt

openssl base64 -in key.pem -out key.txt

But this gist says:

Step 1: Create Certificate .pem from Certificate .p12

Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12

Step 2: Create Key .pem from Key .p12

Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12

None of this worked for me. 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

Post external references

  1. 1
  2. 2