Github has a certificate that matches multiple domains. PHP versions less than 5.6 will not be able to handle this properly with a stream context. The only solution for this is to use CURL since curl supports this out of the box.
Maybe this should be added?
I encountered this problem when writing a self-update command using the phar-updater.