Uwes Blog

Projects, thoughts and more

Sending Apple Push Notifications with Erlang

First of all you have to be sure you have installed Erlang together with SSL. On Mac OS X that can be done with MacPorts:

sudo port install erlang +ssl

Create Certificate and Key for SSL

First export cert and key as p12 (apns-cert.p12, apns-key.p12) with the “Keychain Access” Tool.

After that you can convert the p12 files to pem files:

openssl pkcs12 -clcerts -nokeys -out apns-cert.pem -in apns-cert.p12
openssl pkcs12 -nocerts -out apns-tmp-key.pem -in apns-key.p12 -nodes
openssl rsa -in apns-tmp-key.pem -out apns-key.pem