Kevin Sabbe
Kevin Sabbe

Reputation: 1452

iOS Notifications (Pusher)

I try to add Notifications to my iOS App using Pusher. When I send my device token to the server I go this issue :

Bad HTTP response: <NSHTTPURLResponse: 0x174032be0> { URL: https://nativepushclient-cluster1.pusher.com/client_api/v1/clients } { status code: 401, headers {
    Connection = "keep-alive";
    "Content-Length" = 125;
    "Content-Type" = "application/json";
    Date = "Thu, 09 Mar 2017 10:12:22 GMT";
    Server = Cowboy;
    Via = "1.1 vegur"; } } with body: Optional("{\"error\":\"Invalid application credentials for apns\",\"desc\":\"Unable to read your certificate: failed to decrypt private key\"}\n")

"{\"error\":\"Invalid application credentials for apns\",\"desc\":\"Unable to read your certificate: failed to decrypt private key\"

Any ideas will be strongly appreciate ! (I did have convert my certificate .p12 to .pem (certificate + key in one file, should I create two file?)

I did that :

openssl pkcs12 -in path.p12 -out newfile.pem

Should I do :

openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes

Many thanks !!! 🙏🏼

Upvotes: 1

Views: 766

Answers (1)

Rool Paap
Rool Paap

Reputation: 1976

I used the tutorial from https://github.com/nomad/houston

$ openssl pkcs12 -in cert.p12 -out apple_push_notification.pem -nodes -clcerts

Upvotes: 1

Related Questions