1. log on to the iPhone Developer Connection Portal and click App IDs.
2. Create an App ID that does not use wildcards. The wildcard ID cannot be used for the push notification service. For example, our iPhone program ID is like this: ab123127cd.com. serverdensity. iphone
3. Click "Configure" next to the App ID, and then press the button to generate the push notification license. Follow the steps in the Wizard to generate a signature, upload the signature, and finally download the generated license. This step is also described in the Apple documentation.
4. Double-click the. cer file to introduce your aps_developer_identity.cer to the Keychain.
5. Start the Keychain assistant on Mac, and then select the Certificates category in login keychain. You will see an extensible option "Apple Development Push Services"
6. Expand this option and right-click "Apple Development Push Services"> Export "Apple Development Push Services ID123 ". Save as a apns-dev-cert.p12 file.
7. You need to use terminal commands to convert these files to the PEM format:
Help
1 2 3 |
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 |
In the second statement, you must set an rsa password for it. If you want to remove the password, do not set or execute it during export/conversion:
Help
1 |
Openssl rsa-in apns-dev-key.pem-out unencrypted. pem |
8. Finally, you need to synthesize the key and license file into a apns-dev.pem file that you need to use when connecting to APNS:
Help
1 |
Cat apns-dev-cert.pem unencrypted. pem> apns-dev.pem |
9. Perform a final test on the certificate, and connect it with SSL.
Development Status server address gateway.sandbox.push.apple.com 2195
Product status server address: gateway.push.apple.com 2195
Help
1 2 |
Openssl s_client-connect gateway.sandbox.push.apple.com: 2195 -Cert apns-dev-cert.pem-key unencrypted. pem |
Check whether the operation is successful.
Note: The Last Thing I pay attention to is my own pitfall. Certificates are divided into two types: development and post-release applications.