博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
iOS APNS配置(转)
阅读量:5300 次
发布时间:2019-06-14

本文共 3130 字,大约阅读时间需要 10 分钟。

Introduction

To send Push notification to an application/device couple you need an unique device token (see the ) and a certificate.

Generate a Push Certificate

To generate a certificate on a Mac OS X:

    1. Log-in to the 
    2. Choose App IDs from the menu on the right ()
    3. Create an App ID without a wildcard. For example 3L223ZX9Y3.com.armiento.test
    4. Click the Configure link next to this App ID and then click on the button to start the wizard to generate a new Development Push SSL Certificate ()
    5. Download this certificate and double click on aps_developer_identity.cer to import it into your Keychain
    6. Launch Keychain Assistant (located in Application, Utilities or search for it with Spotlight) and click on My Certificates on the left
    7. Expand Apple Development Push Services and select Apple Development Push Services AND your private key (just under Apple Development Push Services)
    8. Right-click and choose "Export 2 elements..." and save as server_certificates_bundle_sandbox.p12 (don't type a password).
    9. Open Terminal and change directory to location used to save server_certificates_bundle_sandbox.p12 and convert the PKCS12 certificate bundle into PEM format using this command (press enter when asked for Import Password):

 

openssl pkcs12 -in server_certificates_bundle_sandbox.p12 -out server_certificates_bundle_sandbox.pem -nodes -clcerts
  1. Now you can use this PEM file as your certificate in ApnsPHP!

Verify peer using Entrust Root Certification Authority

Download the Entrust Root Authority certificate directly from Entrust Inc. website:

  1. Navigate to 
  2. Choose "Personal Use"
  3. Download the Entrust CA (2048) file (entrust_2048_ca.cer)  for the Sandbox environment; download the Entrust Secure Server CA file (entrust_ssl_ca.cer)  for the Production environmentuntil December 22nd (after December 22nd, 2010 you have to use entrust_2048_ca.cer also for the Production Environment as Apple said: "To ensure you can continue to validate your server's connection to the Apple Push Notification service, you will need to update your push notification server with a copy of the 2048-bit root certificate from Entrust's website.").

If you want to use the same file for the Sandbox and the Production environment please concat the two certificates. For example:

 

wget https://www.entrust.net/downloads/binary/entrust_2048_ca.cer -O - > entrust_root_certification_authority.pemecho >> entrust_root_certification_authority.pemwget https://www.entrust.net/downloads/binary/entrust_ssl_ca.cer -O - >> entrust_root_certification_authority.pem

Otherwise (for use only in a Mac OS X environment), export the Entrust Root Authority certificate:

  1. Launch Keychain Assistant (located in Application, Utilities or search for it with Spotlight) and click on System Root Certificate on top-left and Certificates on the bottom-left
  2. Right-click on Entrust Root Certification Authority and export with entrust_root_certification_authority.pem file name and choose as document format Privacy Enhanced Mail (.pem).
  3. Now you can use this PEM file as Entrust Root Certification Authority in ApnsPHP to verify Apple Peer!

转载于:https://www.cnblogs.com/guola/p/3521081.html

你可能感兴趣的文章
Leetcode 589. N-ary Tree Preorder Traversal
查看>>
thinking back no11
查看>>
机器学习/深度学习/其他开发环境搭建记录
查看>>
xml.exist() 实例演示
查看>>
判断是否为空然后赋值
查看>>
中标麒麟QT+ODBC+人大金仓开发环境配置
查看>>
NopCommerce换主题这件小事
查看>>
zabbix监控日志文件
查看>>
ThinkPHP函数详解:U方法
查看>>
正则表达式
查看>>
pip install torch on windows, and the 'from torch._C import * ImportError: DLL load failed:' s...
查看>>
环套树
查看>>
[转]Repeat Page Header on each Page for reports SSRS
查看>>
java基础(一):我对java的三个环境变量的简单理解和配置
查看>>
arcgis api 4.x for js 结合 Echarts4 实现散点图效果(附源码下载)
查看>>
YTU 2734: 国家排序
查看>>
YTU 2625: B 构造函数和析构函数
查看>>
Notepad++ 16进制编辑功能
查看>>
Caffe: Cannot create Cublas handle. Cublas won't be available
查看>>
Linux 下 LXD 容器搭建 Hadoop 集群
查看>>