生产&沙盒二合一推送证书###
//下载的cer证书转pem
openssl x509 -in aps.cer -inform der -out aps_Production.pem
//导出的p12证书转pem
openssl pkcs12 -nocerts -out pushKey_Production.pem -in apns_Production.p12
//两个pem测试沙河环境推送
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert aps_Production.pem -key pushKey_Production.pem
//两个pem测试正式环境推送
openssl s_client -connect gateway.push.apple.com:2195 -cert aps_Production.pem -key pushKey_Production.pem
//合并两个pem
cat aps_Production.pem pushKey_Production.pem > apns_Production_Final.pem
//合并后的pem转p12
openssl pkcs12 -export -in apns_Production_Final.pem -out apns_Production_Final.p12
沙盒推送证书###
//下载的cer证书转pem
openssl x509 -in aps_development.cer -inform der -out aps_Sandbox.pem
//导出的p12证书转pem
openssl pkcs12 -nocerts -out pushKey_Sandbox.pem -in apns_Sandbox.p12
//两个pem测试沙河环境推送
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert aps_Sandbox.pem -key pushKey_Sandbox.pem
//合并两个pem
cat aps_Sandbox.pem pushKey_Sandbox.pem > apns_Sandbox_Final.pem
//合并后的pem转p12
openssl pkcs12 -export -in apns_Sandbox_Final.pem -out apns_Sandbox_Final.p12
网友评论