cURL unable to get local issuer certificate
<p>I read some SO questions and answers but I can't solve my problem.</p>

<p>I've a cURL request:</p>

<pre><code>function dmd_check_key($arg){
    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_RETURNTRANSFER =&gt; 1,
        CURLOPT_URL =&gt; 'https://***.de/dmd-pages-pro/dmd_key_generator.php?key='.$arg.'&amp;website='.$_SERVER['HTTP_HOST'],
        CURLOPT_USERAGENT =&gt; 'Codular Sample cURL Request',
        CURLOPT_VERBOSE =&gt; 1
    ));
    curl_setopt($curl, CURLOPT_STDERR, fopen("curl_debug.txt", "w+"));
    $resp = curl_exec($curl);
    curl_close($curl);

    if(!get_option('dmd-pages-key-status')){add_option('dmd-pages-key-status', $resp);}else{update_option('dmd-pages-key-status', $resp);}    
    if(!get_option('dmd-pages-key')){add_option('dmd-pages-key', $arg);}else{update_option('dmd-pages-key', $arg);}    

    return $resp;
}
</code></pre>

<p>I got this errormessage:</p>

<blockquote>
  <ul>
  <li>Hostname was NOT found in DNS cache</li>
  <li>Trying 00.13.133.000...</li>
  <li>Connected to dimadirekt.de (00.13.133.000) port 443 (#0)</li>
  <li>successfully set certificate verify locations:</li>
  <li>CAfile: none   CApath: /etc/ssl/certs</li>
  <li>SSL certificate problem: unable to get local issuer certificate</li>
  <li>Closing connection 0</li>
  </ul>
</blockquote>

<p>Can someone explain me the errormessage and how I can resolve it?</p>

<p>I think the problem is the certificate. But on which server? I have two.</p>

<p>One server with the cURL file (nonssl) and one server which handles the data (ssl).</p>

<p>I try this settings:</p>

<pre><code>curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
</code></pre>

<p>But it is still not working.</p>

<p>EDIT:</p>

<p>With the settings line above:</p>

<pre><code>curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
</code></pre>

<p>The errormessage is gone.</p>

<p>Now the problem is that I don't get any response.</p>

<p>Now I get this response:</p>

<blockquote>
  <ul>
  <li>Hostname was NOT found in DNS cache</li>
  <li>Trying 00.13.133.212...</li>
  <li>Connected to ***.de (00.13.000.212) port 443 (#0)</li>
  <li>successfully set certificate verify locations:</li>
  <li>CAfile: none   CApath: /etc/ssl/certs</li>
  <li>SSL connection using ECDHE-RSA-AES128-GCM-SHA256</li>
  <li>Server certificate:</li>
  <li>subject: OU=Domain Control Validated; CN=www.***.de</li>
  <li>start date: 2016-03-03 00:00:00 GMT</li>
  <li>expire date: 2019-06-01 23:59:59 GMT</li>
  <li>subjectAltName: ***.de matched</li>
  <li>issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO RSA Domain Validation Secure Server CA</li>
  <li>SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
  
  <blockquote>
    <p>GET /dmd-pages-pro/dmd_key_generator.php?key=27dda19e85378bb8df73fa3f2806a30c&amp;website=ak.dimadirekt.com
    HTTP/1.1 User-Agent: Codular Sample cURL Request Host: ***.de
    Accept: <em>/</em></p>
  </blockquote></li>
  </ul>
  
  <p>&lt; HTTP/1.1 200 OK &lt; Date: Tue, 31 May 2016 11:07:49 GMT
  * Server Apache is not blacklisted &lt; Server: Apache &lt; Vary: Accept-Encoding &lt; Transfer-Encoding: chunked &lt; Content-Type: text/html
  &lt; 
  * Connection #0 to host dimadirekt.de left intact</p>
</blockquote>