To generate the APNs Service PEM certificate required by PHP

Source: Internet
Author: User
Tags key openssl openssl rsa pkcs12 ssl connection

1. Login to the IPhone Developer Connection Portal and click App IDs
2. Create an App ID that does not use wildcard characters. Wildcard IDs cannot be used with push Notification Services. For example, our iphone program ID looks like this:
3. Click the "Configure" next to the app ID and press the button to produce a push notification license. Follow the steps guided by the wizard to generate a signature and upload, and finally download the generated license. This step is also mentioned in the Apple documentation.
4. Introduce your aps_developer_identity.cer into the keychain by double-clicking the. cer file.
5. Start the Keychain assistant on the Mac, and then select the Certificates category in the login keychain. You will see an extensible option, "Apple Development Push Services"
6. Extend this option and then right-click "Apple Development push Services" > Export "apple Development push Services ID123". Save as a apns-dev-cert.p12 file.
7. These files need to be converted to PEM format via a terminal command:





OpenSSL pkcs12-clcerts-nokeys-out Apns-dev-cert.pem


OpenSSL pkcs12-nocerts-out apns-dev-key.pem-in APNS-DEV-KEY.P12

The second statement, you must set up an RSA password for him, if you want to remove the password, or in the export/conversion do not set or execute:



OpenSSL rsa-in apns-dev-key.pem-out Unencrypted.pem

8. Finally, you need to synthesize the keys and license files as APNS-DEV.PEM files, which need to be used when connecting to APNs:



Cat Apns-dev-cert.pem Unencrypted.pem > Apns-dev.pem

9. To make a final test of the certificate made, with SSL connection.
Development state server Address 2195
Product Status server address 2195




OpenSSL S_client-connect

-cert Apns-dev-cert.pem-key Unencrypted.pem

See if it works.
Note: The last thing I noticed was the pit I had planted myself. Certificates are divided into two types that are developed and used after the release of the program.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.