iOS push certificate to generate pem file (detailed generation process)

     3.1. Open the terminal and enter cd Desktop

cd Desktop

     3.2. Convert the apns-dev-cert.p12 file to pen format, and enter openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12

openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12

1463815-079cbf747bd8813a.png

      A password is required here, enter 123456. (here is the protection password for exporting p12), at this time the desktop will generate an apns-dev-cert.pem file

3.3. Convert the apns-dev-key.p12 file to pen format, enter openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12

openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12

1463815-a6ad22c8fb8e9c49.png

     A password is required here, enter 123456. (Here is the protection password for exporting p12)

1463815-198e219cdff33f3e.png

A protection password is required here, enter 123456.

1463815-2f7ff1d0f1330ef2.png

Here is a requirement to verify the protection password, enter 123456 again, and the desktop will generate an apns-dev-key.pem file

4. Combine the apns-dev-cert.pem and apns-dev-key.pem files into the apns-dev.pem file. This file will be used by the php backend to connect to the Apple server. Continue typing in the terminal: cat apns -dev-cert.pem apns-dev-key.pem> apns-dev.pem, the desktop will generate an apns-dev.pem

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

1463815-a38824f33f8fc153.png

Test in the terminal: openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert apns-dev-cert.pem -key apns-dev-key.pem

The terminal finally displays the following content, indicating that the pem file is successfully configured.

Author: jf of charity

Link: https://www.jianshu.com/p/cc952ea07a08

Source: Brief Book

The copyright belongs to the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.


6936279-c19a11d12d051a74.jpg

Guess you like

Origin blog.csdn.net/qq_35437870/article/details/103161060