i’m trying to implement push notification in my application, for this i tried to use easyApns, i follow the steps, and implement the classes on my linux based. but unfortunately i stil betting some errors related to certificates.
my error is:
Warning: stream_socket_client() [function.stream-socket-client]: SSL
operation failed with code 1. OpenSSL Error messages:
error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate
unknown in /var/www/html/apns/classes/class_APNS.php on line 401Warning: stream_socket_client() [function.stream-socket-client]:
Failed to enable crypto in /var/www/html/apns/classes/class_APNS.php
on line 401Warning: stream_socket_client() [function.stream-socket-client]:
unable to connect to ssl://gateway.sandbox.push.apple.com:2195
(Unknown error) in /var/www/html/apns/classes/class_APNS.php on line
401Notice: Failed to connect to APNS: 0 . 1) APNS::__construct -> File:
apns.php (line 50) 2) APNS::_fetchMessages -> File: class_APNS.php
(line 217) 3) APNS::_pushMessage -> File: class_APNS.php (line 376) 4)
APNS::_triggerError -> File: class_APNS.php (line 405) in
/var/www/html/apns/classes/class_APNS.php on line 509
i gusse it’s an error related to the certificate (the .pem file)
my .pem file wa generated using the following command
openssl pkcs12 -in apns-dev-cert.p12 -out apns-dev-cert.pem -nodes -clcerts
and it was placed on the server (linux based) and given chmod 644 privileges
should i do any thing else…..
Are you able to connect to apns using your certificate? try following command to check that:
If the command terminates, you are not able to connect. If it continues running and lets you type into the socket, you have connected successfully.