Open Voip
Open Voip

Reputation: 133

APNS php to AWS SNS

I am able to send push notification from PHP to my iOS app. I followed this URL: http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1

Now, I need to use Amazon SNS to send the notification but I am not able to pass the first stage in the wizard. something is wrong with the cetifications. I tried to upload the p12 file or copy paste the cert and key with the following command: openssl pkcs12 -in InCert.p12 -out OutCert.pem -nodes -clcerts

but allways get an error. Can I use the same certifications I use with the PHP? is there a way to adjust these certs to work with AWS SNS?

Thanks, Amos

Upvotes: 0

Views: 506

Answers (1)

Matt Bolt
Matt Bolt

Reputation: 440

I had many similar problems getting this to work. I found the only way I could reliably have it accept my certificates was to remove any passwords from the certificates and not bother with the .p12 upload and just manually convert the various certs into the correct format for the Certificate field and the Private Key field.

First Convert the P12 to PEM format

openssl pkcs12 -nocerts -in myprivatekey.p12 -out myprivatekey.pem

Remove Password from PEM file

openssl rsa -in myprivatekey.pem -out myprivatekey-nopass.pem

Upload Certificates

Finally, Copy and paste the contents of the cer file you got from Apple and then the contents of the nopass.pem file you just created to the SNS Application setup.

Upvotes: 1

Related Questions