Apple Developer Account generates invalid push certificates

1.4k Views Asked by At

I am trying to configure the AWS Mobile Hub for APNS. I am having 2 problems that I think are related.

In the Apple Developers Portal I have 2 valid Provisioning Profiles for the app, iOS Development and iOS Distribution (all certificates have expiration dates in the future). When I generate and download the Development Push Certificate, and then look back at the Provisioning Profiles, both profiles are marked as invalid. I can edit the profiles and render them valid again, but they are invalidated when I revoke the Development Push Certificate and create another (I re-create the push certificate because I am not certain it’s valid).

When I try to add push notifications to my AWS Mobile Hub project by uploading a Development Push Certificate (created as above) I get an error:

Invalid parameter: Attributes Reason: Platform credentials are invalid

I have repeated this process several times and the same things always happen. If I revoke and recreate the invalidated Provisioning Profiles, I get the same sequence of events. I have no idea why generating Push Certificates invalidates Provisioning Profiles. Since the Push Certificates upload successfully I assume their formats are correct. I don’t know what parameter in the certificates might be the source of the error.

What is going on?

1

There are 1 best solutions below

2
On BEST ANSWER

The reason is In Mac, One keychain key can access multiple-Apple certificate.

The app development cert and app APNS cert share the same keychain key(.p12). However, the same keychain key(.p12) only contains the information of the app development cert.

You need to opened the keychain(.p12) as pem format, and find the AWS SNS console accidentally auto-load the app-development certificate in the keychain key(.p12) which will cause the following errors.

Invalid parameter: Attributes Reason: Platform credentials are invalid (Service: AmazonSNS; Status Code: 400; Error Code: InvalidParameter; Request ID: ...........)

To convert the cert to pem, please reference the AWS guide SNSMobilePushAPNSAPI

openssl pkcs12 -in myapnsappprivatekey.p12 -out myapnsappprivatekey.pem -nodes -clcerts openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert myapnsappcert.pem -key myapnsappprivatekey.pem

You will find more detail in Amazon AWS forum on below link.

Platform credentials are invalid