- Go to Apple Dev certs here
- Identifiers -> Find identifier in question
- Find the correct identifier (prod or stage)
- Push Notification capabiity
- Configure certificates
- Upload certSigningRequest
- Download .cert file, click on it to add to keychain
- Open terminal, navigate to directory that :point-up is saved
- Export cert as a p12 file
- Run this command to generate the cert.pem from the .p12 file:
- I'll assume your p12 file is name
cred_prod.p12
. If yours is named something else make sure to swap that out in these commands
openssl pkcs12 -clcerts -nokeys -out cert_prod.pem -in cred_prod.p12
- Then run this command to generate the Key.pem from the .p12 file:
openssl pkcs12 -in cred_prod.p12 -nocerts -out key_prod.pem -nodes
- Run this command to remove the encoding of the private key:
openssl rsa -in key_prod.pem -out key_prod_noenc.pem
- Run this command to verify everything worked
openssl s_client -connect gateway.push.apple.com:2195 -cert cert_prod.pem -key key_prod_noenc.pem
for sandbox push certificates:
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert cert_dev.pem -key key_dev_noenc.pem
- Open the
cert_prod.pem
file in your favorite text editor. - Copy everything between and including the
-----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----
for later use - Open the
key_prod_noenc.pem
file in your favorite text editor - Copy everything between and including:
-----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY-----
- Go to the Twilio console here
- Update or create a new credential.
- Paste in the text of both the crediential and private key
- Save the Credential.
- Celebrate 🎉