问题
I'm getting the following error when call the CURL with https url:
"SSL certificate problem: unable to get local issuer certificate"
$ch = curl_init($sendurl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) .'/cert/uat.abc.pem');
echo $result = curl_exec($ch);
echo curl_error($ch);
Does anyone know how to set it up?
回答1:
I think you can set CURLOPT_SSLCERT option to fix it,or use curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1) and curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false) to ignore this warming
来源:https://stackoverflow.com/questions/32264938/unable-to-get-local-issuer-certificate-using-curl