When using the https protocol you'll have to make sure to set the right context options to use the full "power" of the ssl/tls encryption.
<?php
$url = 'https://secure.example.com/test/1';
$contextOptions = array(
    'ssl' => array(
        'verify_peer'   => true,
        'cafile'        => __DIR__ . '/cacert.pem',
        'verify_depth'  => 5,
        'CN_match'      => 'secure.example.com'
    )
);
$sslContext = stream_context_create($contextOptions);
$result = file_get_contents($url, NULL, $sslContext);
?>
More information about those context options can be found at http://php.net/manual/en/context.ssl.php