I have replaced my calls to
$content = file_get_contents($url);
with a curl call...
$curl = curl_init($url);
if (is_resource($curl) === true) { curl_setopt($curl, CURLOPT_FAILONERROR, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSLVERSION, 3); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
if (isset($post) === true) { curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, (is_array($post) === true) ? http_build_query($post, '', '&') : $post); }
$content = curl_exec($curl);
curl_close($curl); }
Key point here is ----> curl_setopt($curl, CURLOPT_SSLVERSION, 3);
This seems to work on http and https sites.
I have replaced my calls to
$content = file_get_ contents( $url);
with a curl call...
$curl = curl_init($url);
if (is_resource($curl) === true)
curl_setopt( $curl, CURLOPT_ FAILONERROR, true);
curl_setopt( $curl, CURLOPT_ FOLLOWLOCATION, true);
curl_setopt( $curl, CURLOPT_ RETURNTRANSFER, true);
curl_setopt( $curl, CURLOPT_SSLVERSION, 3);
curl_setopt( $curl, CURLOPT_ SSL_VERIFYPEER, true);
curl_setopt( $curl, CURLOPT_ SSL_VERIFYHOST, 2);
{
if (isset($post) === true)
curl_ setopt( $curl, CURLOPT_POST, true);
curl_ setopt( $curl, CURLOPT_POSTFIELDS, (is_array($post) === true) ? http_build_ query($ post, '', '&') : $post);
{
}
}
Key point here is ----> curl_setopt($curl, CURLOPT_SSLVERSION, 3);
This seems to work on http and https sites.