I use the following PHP curl request to scrape the data from a remote website:
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // Skip SSL Verification
$rsData = curl_exec($ch);
curl_close($ch);
return $rsData;
Now when I try to scrape the data from https://www.dsebd.org
, I have to mention https://
in the $URL
. Without mentioning the https://
, no data is retrieving. But as far I can understand, as CURLOPT_SSL_VERIFYPEER
is set to 0
, I can omit the https://
from the $URL
.
Then, why the CURLOPT_SSL_VERIFYPEER
is not working in my case?