1

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?

mck89
  • 18,918
  • 16
  • 89
  • 106
user831098
  • 1,803
  • 6
  • 27
  • 47

1 Answers1

0

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

luoziluojun
  • 116
  • 10