I\'ve been working through Ray Wenderlich\'s tutorials on push notifications using a PHP Script.
Reference: http://www.raywenderlich.com/32960/apple-push-notificatio
Updated to macOS Sierra 10.12.4
The problem is in new PHP Version in macOS Sierra. They changed the way it works with certificates.
I would suggest a small changes in the accepted answer to make things explicit.
You have to setup path to entrust_2048_ca.cer and other parameters during creation of the stream context like
$streamContext = stream_context_create([
'ssl' => [
'verify_peer' => true,
'verify_peer_name' => true,
'cafile' => '/path/to/bundle/entrust_2048_ca.cer',
]
]);
The full explanation and links are here