查看完整版本: 如果製作 ios 推播push server 所需要的憑證


ilike86 2015-7-3 16:23

如果製作 ios 推播push server 所需要的憑證

要在 ios 設定推播 , 整個過程分成3個部份<br><br>1.開通註冊憑證 cert、p12、pem等等有的沒的...<br>2.在程序中加入程序拿到devicetoken<br>3.在push server上發送訊息<br><br>這邊主要講的是憑證的生成步驟:<br><br>假設拿到這兩個憑證檔:<br>adj_aps_production.cer<br>adj_aps_production_key.p12<br><br>最後需要生成一個 aps_production.pem<br><br>步驟如下:<br><br># openssl x509 -in adj_aps_production.cer -inform DER -out adj_aps_production.pem -outform PEM}<br><br># openssl pkcs12 -nocerts -out adj_aps_production_key.pem -in adj_aps_production_key.p12<br><br># openssl rsa -out adj_aps_production_key_noenc.pem -in adj_aps_production_key.pem<br><br># cat adj_aps_production.pem adj_aps_production_key_noenc.pem &gt; aps_production.pem<br><br>最後你可以在osx底下這樣測試你的pem是否正常:<br><br># openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert adj_aps_production.pem -key aps_production.pem<br><br>如果出現<br>[quote]<br>.....<br>.....<br>New, TLSv1/SSLv3, Cipher is AES256-SHA<br>Server public key is 2048 bit<br>Secure Renegotiation IS supported<br>Compression: NONE<br>Expansion: NONE<br>SSL-Session:<br>&nbsp; &nbsp; Protocol&nbsp;&nbsp;: TLSv1<br>&nbsp; &nbsp; Cipher&nbsp; &nbsp; : AES256-SHA<br>&nbsp; &nbsp; Session-ID: <br>&nbsp; &nbsp; Session-ID-ctx: <br>&nbsp; &nbsp; Master-Key: 8AE6DEA7F4CD980532E118E0A5A6CC8B6DF1A07D7C1EF811874532AA1F67B9AC94ED732A129F3710965A3829FAA2BE23<br>&nbsp; &nbsp; Key-Arg&nbsp; &nbsp;: None<br>&nbsp; &nbsp; Start Time: 1435909777<br>&nbsp; &nbsp; Timeout&nbsp; &nbsp;: 300 (sec)<br>&nbsp; &nbsp; Verify return code: 0 (ok)<br>[/quote]<br><br>這樣就代表 ok 囉<br><br>參考文章: http://chapiplus.blogspot.tw/2014/10/ios-push-server.html<br>
頁: [1]
查看完整版本: 如果製作 ios 推播push server 所需要的憑證