I am using the following code to access a URL (the URL uses the https protocol, and has a valid certificate)
// Initialize session and set URL.
$url = https://my url;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// Set so curl_exec returns the result instead of outputting it.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Get the response and close the channel.
$response = curl_exec($ch);
curl_close($ch);
But the output i get is this:
Failed: Error Number: 60. Reason: SSL certificate problem, verify that
the CA cert is OK. Details: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Can somebody please guide me?
use ‘CURLOPT_RETURNTRANSFER’
for more info read this