iOS推送证书创建见其他教程
公钥生成
推送证书cer转pem
openssl x509 -in aps_development.cer -inform der -out apns-dev-cert.pem
也可以用钥匙串中证书导出p12,然后转为pem公钥
openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-develop.p12
私钥生成
如果按其他教程生成后无法连接
unable to load client certificate private key file
140735697032136:error:0906D06C:PEM routines:PEM_read_bio:no start line:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-22.50.2/libressl/crypto/pem/pem_lib.c:704:Expecting: ANY PRIVATE KEY
需要重新转换私钥
openssl pkcs12 -in push.p12 -out apns-dev-key.pem -nodes
合并
cat apns-dev-cert.pem apns-dev-key.pem > push.pem