I
I
Igor2016-06-04 14:00:44
PHP
Igor, 2016-06-04 14:00:44

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);

I'm testing on a site without SSL - everything works.
I put on a site with SSL - the result is blocked
Tell me how to make a cURL request from a site with an SSL certificate?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey, 2016-06-04
@alsopub

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.

T
ThunderCat, 2016-06-04
@ThunderCat

in search!

#
#algooptimize #bottize, 2016-06-04
@user004

$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 question

Ask a Question

731 491 924 answers to any question