如何申請 iOS 推播憑證

大致上申請流程可以參考 Collyn Chen 的文章

有一點要補充的是
最後產生 .pem 那段
我在 macOS High Sierra 10.13.6 上無法正常運作
查了一下我的 openssl 是 LibreSSL 2.2.7
居然不是 openssl ?

在執行這段指令時會發生以下錯誤


後來改了參數後就可以 work 囉!
$ openssl pkcs12 -in filename.p12 -out filename.pem -nocerts -nodes

另外這邊要補充一個測試憑證的工具
取得 Device Token 後直接把憑證餵進去
就可以馬上收到推播囉!
請注意,這個工具是使用 .cer 檔,不是 .pem 檔喔!



2018.08.10 補充
後來用上述指令產生出來的 pem 無法用程式發推播
將 -nocerts 參數改成 -clcerts 才行
$ openssl pkcs12 -in filename.p12 -out filename.pem -clcerts -nodes
這時候系統卻不會出現上面的錯誤
中間做了什麼已經不可考了

Comments

Popular posts from this blog

CentOS7 如何新增/移除 Rich Rule for firewalld

mac 安裝 mtr

Howto use Postman test Cors