Certificate for APNS

I keep forgetting how to generate the Apple Push Notification SSL certificate…..
It is not super complicated but not just one click thing.
So I decided to write this step down somewhere.

Here’s simple steps how to build it.

1. Log in to the iPhone Developer connection Portal and click App IDs.

2. Ensure you have created an App ID without a wildcard. Wildcard IDs cannot use the push notification service. For example, our iPhone application ID looks something like app.com.smartdate.iphone

3. Click Configure next to your App ID and then click the button to generate a Push Notification certificate. A wizard will appear guiding you through the steps to generate a signing authority and then upload it to the portal, then download the newly generated certificate. This step is also covered in the Apple documentation.

4. Import your aps_developer_identity.cer into your Keychain by double clicking the .cer file.

5. Launch Keychain Assistant from your local Mac and from the login keychain, filter by the Certificates category. You will see an expandable option called “Apple Development IOS Push Services”

6. Expand this option then right click on “Apple Development IOS Push Services” > Export “Apple Development Push Services ID123″. Save this as apns-dev-cert.p12 file somewhere you can access it.

7. Do the same again for the “Private Key” that was revealed when you expanded “Apple Development IOS Push Services” ensuring you save it as apns-dev-key.p12 file.

8. These files now need to be converted to the PEM format by executing this command from the terminal:
openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12

9. If you wish to remove the passphrase, either do not set one when exporting/converting or execute:
openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem

10. Finally, you need to combine the key and cert files into a apns-dev.pem file we will use when connecting to APNS:
cat apns-dev-cert.pem apns-dev-key-noenc.pem > apns-dev.pem

It’s good idea to keep the files and given them descriptive names should you need to use them at a later date. The same process above applies when generating the production certificate.

If anyone wants to see more information about the process to build APN provider server, please take a look here. How to build an Apple Push Notification provider service (tutorial)


답글 남기기

아래 항목을 채우거나 오른쪽 아이콘 중 하나를 클릭하여 로그 인 하세요:

WordPress.com 로고

WordPress.com의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Google photo

Google의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Twitter 사진

Twitter의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Facebook 사진

Facebook의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

%s에 연결하는 중

%d 블로거가 이것을 좋아합니다: