I would like to communicate with the Apple Push Notification Service from a PHP script.
But I keep getting following error:
Warning: stream_socket_client(): Unable to set private key file
I have a .pem-file which looks like this:
-----BEGIN CERTIFICATE-----
Encrypted String
-----END CERTIFICATE-----
Bag Attributes
friendlyName: ...
localKeyID: ...
Key Attributes: ...
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: ...
DEK-Info: ...
Encrypted String
-----END RSA PRIVATE KEY-----
I am running the PHP script from sudo. It can find my .pem file, because if I remove it, I get a "handshake failure" error instead.
What could be wrong here?
I got it working. It turns out I exported my private key which I generated for the push notifications instead of the corresponding certificate.