This code: (https://github.com/stuffmc/Safari-Push-Notifications/blob/master/index.php#L195)
stream_socket_client('ssl://gateway.push.apple.com:2195', $error, $errorString,
60, STREAM_CLIENT_CONNECT, $streamContext);
returns false
, but with no errors. It means that when I'm sending to /v1/push it fails for every device/token :( The PHP documentation says:
If the value returned in errno is 0 and the function returned FALSE, it is an indication that the error occurred before the connect() call. This is most likely due to a problem initializing the socket.
I have this code running perfectly for a website (dev/beta/staging) and now that I'm trying to move to production, it doesn't.
I should note though that calling
$ openssl s_client -connect gateway.push.apple.com:2195 -cert MyC.pem -key myK.pem
perfectly works. I have a prompt where I can type characters and when typing enter, it exits — same as with my dev test.
I also have nothing sent to /v1/log
(as mentionned at https://devforums.apple.com/thread/203825) and so I'm clueless as to where the problem would be :(