After upgrading to PHP 5.6 I get an error when trying to connect to a server via fsockopen()..
fsockopen()
The certificate on the server (host) is self-signed
If you are using macOS sierra there is a update in PHP version. you need to have Entrust.net Certificate Authority (2048) file added to the PHP code. more info check accepted answer here Push Notification in PHP using PEM file