1

I'm trying to send ios notification with laravel (use laravel-push-notification) but I get this error:
Unable to connect: tls://gateway.sandbox.push.apple.com:2195: 2 (stream_socket_client(): Unable to set private key file /certificate/path.pem)
Here is my config:
'appNameIOS' => array( 'environment' =>'development', 'certificate' =>'../path.pem', 'passPhrase' => 'passPhrase', 'service' =>'apns' ),

But after I remove the quotes from passPhrase I just getting HTTP error 500 without any error on response body.

I created .pem files from this site step by step.

NOTE: I'm using MAMP server.

2
  • 1
    Most likely your path to 'certificate' in not correct. I would debug that. Apr 10, 2016 at 1:39
  • @AngadDubey I enter the certificate path correct in my app. Because if I insert wrong path I get Certificate ../../PushCert.pem does not exist. NOTE: I edited the sample path in my question.
    – Hamid
    Apr 10, 2016 at 4:49

1 Answer 1

2

I think that the pem certificate was not created correctly. Be sure to export both the private and public key together from the p12 keychain element. Follow indications here.

1
  • Yes. I created pem file again and everything is ok, but I have another problem. When I send notification, $push->getFeedback(); return empty array. How can I track notification. How can I know the notification was sent or not or if a problem occurs?
    – Hamid
    Apr 10, 2016 at 16:39

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.