IOS server-side Push certificate P12 file authoring

Source: Internet
Author: User
Tags openssl x509 pkcs12

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.