Definitely agree with farmer1992.
For anyone having issues with file_get_contents
over SSL + proxy, there is a known bug with PHP's stream_context_create:
https://bugs.php.net/bug.php?id=63519
Fortunately, the workaround is simple. Basically, the context creator gets confused when parsing an "https" target URL to both the proxy and SSL configs. You just have to set the SNI_server_name in the SSL config:
$targetUrl = "https://something.com";
$sniServer = parse_url($targetUrl, PHP_URL_HOST);
$params = array('your'=>'post','params'=>'here');
$ctxConfig = array(
'http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded'."\r\n",
'content' => http_build_query($params),
'proxy' => 'tcp://12.34.56.78:3128',
'request_fulluri' => true
),
'ssl' => array(
'SNI_enabled' => true,
'SNI_server_name' => $sniServer
)
);
$context = stream_context_create($ctxConfig);
file_get_contents($targetUrl,false,$context)
Hopefully that saves someone some time!