PHP's certificate configuration for HTTPS is server-side-verified by default, and the HTTPS path cannot be requested if certificate validation is not configured on the server side. If you do not need to configure an HTTPS certificate for ease of use, configure curl with the following two keys set to False
curl_setopt ($ch, Curlopt_ssl_verifypeer, FALSE);
curl_setopt ($ch, Curlopt_ssl_verifyhost, FALSE);
Attach the complete function:
Private Function HttpGet ($url) {
$ch = Curl_init ();
Setting options, including URLs
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_ssl_verifypeer, FALSE);
curl_setopt ($ch, Curlopt_ssl_verifyhost, FALSE);
curl_setopt ($ch, Curlopt_returntransfer, 1);
curl_setopt ($ch, Curlopt_header, 0);
Execute and get HTML document content
$output = curl_exec ($ch);
Releasing the curl handle
Curl_close ($ch);
Print the obtained data
return $output;
}
PHP Curl Request for HTTPS encounter pit