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
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
A password is required here, enter 123456. (Here is the protection password for exporting p12)
A protection password is required here, enter 123456.
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
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.