Connect to APNS by using PHP

282 Views Asked by At

I am facing problem in connecting to APNS by using PHP. According to my learning so far :-

  1. Cerificate, private key and passphrase are correct because I have tested it using third party notification providers, also it works on my server for some time and then it stops working.
  2. It is configured correctly in the app because I can receive the notifications sometimes.

So in short, it works fine for 2-3 times, then it just stops working with following Errors :

    Warning:  stream_socket_client() [function.stream-socket-client]: SSL: Connection reset by peer in /home/sites/mydomain.com/public_html/saloon-app/webservices/test.php on line 52



    Warning:  stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in /home/sites/mydomain.com/public_html/saloon-app/webservices/test.php on line 52



    Warning:  stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.push.apple.com:2195 (Unknown error) in /home/sites/mydomain.com/public_html/saloon-app/webservices/test.php on line 52

    ERROR:: CODE(0):: bool(false)
0

There are 0 best solutions below