Answer the question
In order to leave comments, you need to log in
Why doesn't cURL from a site with SSL let through?
The essence of the matter. I have an SSL certificate on my site.
I am trying to parse data via cURL
$url="http://site.ru";
$agent= 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)';
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL,$url);
$result=curl_exec($ch);
Answer the question
In order to leave comments, you need to log in
How can we help you if we do not know the site address or the error...
With a high probability, the SSL certificate is installed incorrectly, either it works only through SNI, or for some reason it does not let you in at 443.
Try to open https://ya.ru like this , if it works, then you need to look at what is the problem with the certificate.
$url=" site.com ";
Well, if it’s the same in battle, then there’s not an HTTPS link and the port may be the wrong one by default, or I didn’t understand something ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question