PushNotification icon indicating copy to clipboard operation
PushNotification copied to clipboard

.pem certificate and key not working with this package

Open annethereshewent opened this issue 5 years ago • 3 comments

So I'm using this guide https://github.com/Edujugon/PushNotification/wiki/APNS-Certificate to generate a pem file with both a cert and key, however it's not working. I get the following error:

Connection problem: stream_socket_client(): Unable to set private key file `/var/www/push-server/storage/certificates/apns-dev.pem'

Is there something I'm doing wrong? I noticed that there's no public keys in that file, only private keys. Is that an issue?

annethereshewent avatar Aug 29 '19 19:08 annethereshewent

update: the certificate generated by the instructions works if i do a manual curl request to the apple push server. something funky is going on with this package.

annethereshewent avatar Aug 29 '19 20:08 annethereshewent

experiencing same issue here.

IllesAprod avatar Sep 13 '19 10:09 IllesAprod

@annethereshewent I have found out, that you have to export your certificate from keychain as .p12 (it is only available if you select 'My certificates' in the sidebar) than you have to convert it with terminal:

openssl pkcs12 -in yourcert.p12 -out yourcert.pem -nodes -clcerts

Than your .pem is created, and working with this package!

Hope it helps!

IllesAprod avatar Sep 13 '19 10:09 IllesAprod