A, Apple server address:
Production and the the push service is different for Development
P
Dev is:$apnsHost = ' gateway.sandbox.push.apple.com ';
Pro is:$apnsHost = ' gateway.push.apple.com ';
So you can test directly in the terminal whether the network connectivity: (Terminal command)
telnet gateway.sandbox.push.apple.com 2195
telnet gateway.push.apple.com 2195
therefore, when the server development needs to pay attention to different deployment, needs to connect the different server;
B, p12 file production (dev and pro same)
Before configuring the P12 certificate file, we want to prepare three files
1. pushchat.certsigningrequest Request certificate file
2. After PUSHCHATKEY.P12 request the certificate file, a public and private key is generated in the certificate key, and the P12 file exported through the private key
3. Aps_developer_identity.cer using the request certificate file to generate the push certificate (downloaded in the app)
Specific configuration actions:
Using OpenSSL
1. Convert Aps_developer_identity.cer to APS_DEVELOPER_IDENTITY.PEM format.
OpenSSL x509-in aps_developer_identity.cer-inform der-out aps_developer_identity.pem-outform PEM
2, the P12 format of the private key conversion to PEM, you need to set 4 times the password, the password is set to: abc123. (Pro when I use the English password, the server side is always not used, and then I changed to a full number)
OpenSSL pkcs12-nocerts-out pushchat_noenc.pem-in PUSHCHATKEY.P12
3. Create pkcs#12 format files with certificate and the key.
OpenSSL pkcs12-export-in aps_developer_identity.pem-inkey pushchat_noenc.pem-certfile PushChat.certSigningRequest- Name "Aps_developer_identity"-out aps_developer_identity.p12
So we get the certificate file that we used in the. NET application: APS_DEVELOPER_IDENTITY.P12
Initial measurement of PEM files after configuration is complete
Validation Certificate//Development
OpenSSL s_client-connect Gateway.sandbox.push.apple.com:2195-cert Aps_developer_identity.pem-key Push_Noenc.pem
Production
OpenSSL s_client-connect Gateway.push.apple.com:2195-cert Aps_production.pem-key Push_noenc.pem
IOS server-side Push certificate P12 file authoring