search
Homephp教程php手册生成php所需要的APNS Service pem证书的步骤

1.登录到 iPhone Developer Connection Portal 并点击 App IDs
2.创建一个不使用通配符的 App ID 。通配符 ID 不能用于推送通知服务。例如,我们的iPhone程序ID像这样: AB123346CD.com.serverdensity.iphone
3.点击App ID旁的“Configure”,然后按下按钮生产 推送通知许可证。根据“向导”指导的步骤生成一个签名并上传,最后下载生成的许可证。此步骤在 Apple文档中 也有谈到。
4.通过双击.cer文件将你的 aps_developer_identity.cer 引入Keychain中。
5.在Mac上启动 Keychain助手,然后在login keychain中选择 Certificates分类。你将看到一个可扩展选项“Apple Development Push Services”
6.扩展此选项然后右击“Apple Development Push Services” > Export “Apple Development Push Services ID123”。保存为 apns-dev-cert.p12 文件。
7.需要通过终端命令将这些文件转换为PEM格式:

帮助

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

第二个语句,必须为他设置个rsa密码,如果你想要移除密码,要么在导出/转换时不要设定或者执行:

帮助

1

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

8.最后,你需要将键和许可文件合成为apns-dev.pem文件,此文件在连接到APNS时需要使用:

帮助

1

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

9.要对做成的证书做一个最后的测试,用SSL连接一下。
开发状态服务器地址 gateway.sandbox.push.apple.com 2195
产品状态服务器地址 gateway.push.apple.com 2195

帮助

1

2

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

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

看看能不能成功
注:最后注意的事,也是我自己栽过的坑。证书分了两种一种是开发的用的,一种是发布的程序后用的。



Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft