为什么Facebook Graph API会在PHP中出现SSL错误?

Every time I try to use the Facebook Graph API in PHP 5.6 it gives me the following errors:

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

Warning: file_get_contents(): Failed to enable crypto in /home/xxx/public_html/api/v1/test.php

To begin with I was using the PHP SDK v4, but I'm now simply trying to connect to this URL:

https://graph.facebook.com/me?access_token=XXXXX

using the following code:

$url = "https://graph.facebook.com/me?access_token=XXXXX";
$result = file_get_contents($url);
$json_response = json_decode($result);
var_dump($json_response);

I have also tried every combination of manually setting the SSL mode and using cURL that I can find on Google but it always gives me the same error. Is there a server setting that I need to change/enable or am I making a simple mistake?

EDIT: When I try to set the cipher mode to TLS 1.2 using cURL it gives the same error:

$ch = curl_init();
curl_setopt_array( $ch, array(
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSLVERSION => 'TLSv1_2',
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_VERBOSE => true
) );
$output = curl_exec( $ch );
echo $output;

echo 'error:' . curl_error( $ch );

curl_close($ch);

error:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol