I am having big problems with accessing lots of https sites to download pages and especially files.
I have done multiple searches on the interweb over this problem and the bulk of them say the same thing:
use the following:
curl_setopt($ch, CURLOPT_SSLVERSION,3);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
But this never seems to work for me.
I have also tried downloading the SSL certificate but that does not help either. I have also upgraded my curl lib to the very latest as I understand that could cause issues.
I am using PHP5, and it is not an option for me to upgrade above that.
Here is an example of my code and one of the urls I am trying to access:
<?php
$file_source="https://www.faa.gov/"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $file_source);
curl_setopt($ch, CURLOPT_REFERER, $file_source);
curl_setopt($ch, CURLOPT_USERAGENT, "MozillaXYZ/1.0");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_SSLVERSION,3);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
$data = curl_exec ($ch);
$error = curl_error($ch);
curl_close ($ch);
?>
Can anyone please help as I am tearing my hair out over this.
MTIA Alexis