Ios – Does the apple push notification distribution certificate signing request need to be the same as that used for the distribution cert to sign the app

certificateiospush-notification

I have an existing app that I have created, and I have recently configured push notifications.

When configuring, I am asked to upload a certificate signing request (CSR). I no longer have the original CSR that I used to publish my app. Is this the CSR I need to upload to the push notification configuration to receive my push notification certificate?

I have my distribution cert with private key available.

I have tried to create a new CSR to upload to the developer portal to retrieve my push notification certificate.

When I combine this file with my private key (p12 file) and attempt to connect to the push notification server I get the following error:

error setting private key
42600:error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch:/SourceCache/OpenSSL098/OpenSSL098-44/src/crypto/x509/x509_cmp.c:406:

Is this happening because of the new CSR I used to create the push notification cert?

Best Answer

it's perfectly fine to generate a new CSR. You just have the wrong private key in your .p12 file.

Generate the push certificate, then download it from Apple and double-click it to add it to your Keychain.

Open Keychain access, find the Push Certificate in "My Certificates", and expand it. You should see a private key underneath, that's the right one for this certificate. Select both the certificate and its private key, right click and select "Export 2 items…".

With the resulting .p12 file, everything should work fine.

Related Topic