cURL error 60: SSL certificate problem: unable to get local issuer certificate

Discussion in 'Linux Guides' started by Chuck, Dec 8, 2017.

  1. Chuck

    Chuck Administrator
    Staff Member Grep What?

    May 17, 2017
    Likes Received:
    If you run into this error on servers it is most likely the destination server that has an SSL issue. To confirm that curl + SSL is good on your account / server here at kickassd you can use the following script:

    function kic_cURLTest($url, $msg, $testText){
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36");
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_TIMEOUT, 10);
      curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
      $response = curl_exec($ch);
      $errmsg = curl_error($ch);
      $cInfo = curl_getinfo($ch);
      echo "Testing ... ".$url." - ".$cInfo['url']."<br />";
      if (stripos($response, $testText)!==false)
        echo "....".$msg." - OK<br />";
        echo "....<b style='color:red;'>".$msg." - Problem</b><br /><pre>";
        echo "</pre>There is a problem with cURL. You need to contact your server admin or hosting provider.";
      kic_cURLTest("", "HTTP to Google", "Mountain View, CA");
      kic_cURLTest("", "HTTPS to Google", "Mountain View, CA");
      kic_cURLTest("", "HTTPS to Facebook", 'id="facebook"');
      kic_cURLTest("", "HTTPS to API (Graph) Facebook", 'get');
      kic_cURLTest("", "HTTPS to LinkedIn", 'rel="canonical" href="');
      kic_cURLTest("", "HTTPS to Twitter", '<link rel="canonical" href="');
      kic_cURLTest("", "HTTPS to Pinterest", 'content="Pinterest"');

    This should return all "OK". Now you will want to check the destination SSL, you can do this by entering the URL at:

    Most likely it is going to show a broken chain and the admin of that server will need to fix it.

    If the above script shows a problem and you are not hosted on Kickassd you will need to diagnose this issue and repair it. It could be one of many things as is beyond the scope of this article. Try asking in the Web Hosting Help forum if you require further help.
    #1 Chuck, Dec 8, 2017
    Last edited: Dec 8, 2017

Share This Page