Home > Backend Development > PHP Tutorial > Steps to generate the APNS Service pem certificate required by PHP_PHP Tutorial

Steps to generate the APNS Service pem certificate required by PHP_PHP Tutorial

WBOY
Release: 2016-07-13 10:41:32
Original
981 people have browsed it

1. Log in to iPhone Developer Connection Portal and click App IDs
2. Create an App ID without using wildcards. Wildcard IDs cannot be used with push notification services. For example, our iPhone app ID looks like this: AB123346CD.com.serverdensity.iphone
3. Click "Configure" next to the App ID and press the button Produce Push Notification License. Follow the steps guided by the "Wizard" to generate a signature and upload it, and finally download the generated license. This step is also covered in Apple documentation.
4. Introduce your aps_developer_identity.cer into Keychain by double-clicking the .cer file.
5. Start the Keychain Assistant on your Mac, and then select the Certificates category in the login keychain. You will see an expandable option "Apple Development Push Services"
6. Expand this option and right-click on “Apple Development Push Services” > Export “Apple Development Push Services ID123”. Save as apns-dev-cert.p12 file.
7. These files need to be converted to PEM format via terminal command:

Help

1

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

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

1

openssl rsa -in apns-dev-key.pem -out unencrypted.pem

For the second statement, an rsa password must be set for it. If you want to remove the password, either do not set or execute it during export/conversion:

Help

1

1

cat apns-dev-cert.pem unencrypted.pem > apns-dev.pem

openssl rsa -in apns-dev-key.pem -out unencrypted.pem


8. Finally, you need to combine the key and license files into the apns-dev.pem file, which is required when connecting to APNS:
Help

1

cat apns-dev-cert.pem unencrypted.pem > apns-dev.pem

1

2

openssl s_client -connect gateway.sandbox.push.apple.com:2195

-cert apns-dev-cert.pem -key unencrypted.pem

9. To do a final test on the completed certificate, 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

Let’s see if it works Note: The last thing I paid attention to was also a pitfall that I fell into. There are two types of certificates: one is for development, and the other is for use after the program is released. http://www.bkjia.com/PHPjc/678032.html
www.bkjia.comtrue
http: //www.bkjia.com/PHPjc/678032.htmlTechArticle1. Log in to the iPhone Developer Connection Portal and click App IDs 2. Create an App ID without using wildcards. Wildcard IDs cannot be used with push notification services. For example, our iPhone...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template