title: cURL error on Wamp : error setting certificate verify locations (77)
body: <p>I'm discovering the cURL lib and I'm trying to reach a resource from a data public website.
  This is my current <strong>index.php</strong> file:
  <em>&lt;api_key&gt; is voluntary hidden.</em></p>
  <pre><code>&lt;?php 
  $curl = curl_init('https://cdt.hafas.de/opendata/apiserver/departureBoard?accessId=&lt;api_key&gt;&amp;lang=fr&amp;id=200404001&amp;format=json');
  curl_setopt($curl, CURLOPT_CAINFO, 'cert.cer');
  $data = curl_exec($curl);
  
  if ($data === false){
      var_dump(curl_error($curl));
  }
  
  curl_close($curl);
  </code></pre>
  <p>Unfortunately I got this error with Wamp:</p>
  <pre><code>C:\wamp64\www\am-sn\index.php:7:string 'error setting certificate verify locations:
    CAfile: cert.cer
    CApath: none' (length=77)
  </code></pre>
  <hr />
  <p>This is what I tried so far:</p>
  <p><strong>1.</strong> Downloaded the certificate from the target website (format X509 - base64) that I renamed to <strong>cert.cer</strong> and placed it in the same folder as my <strong>index.php</strong> file.</p>
  <p><strong>2.</strong> Downloaded file (renamed to <strong>cacert.pem</strong>) from <a href="https://curl.se/ca/cacert-2022-07-19.pem" rel="nofollow noreferrer">https://curl.se/ca/cacert-2022-07-19.pem</a> and placed it in <em>&quot;C:/wamp64/bin/php/php7.4.0/extras/ssl/&quot;</em></p>
  <p><strong>3.</strong> Went to <em>&quot;C:/wamp64/bin/php/php7.4.0/&quot;</em> and edited the <strong>php.ini</strong> file to uncomment those line and set the relative paths:</p>
  <pre><code>curl.cainfo=&quot;C:\wamp64\bin\php\php7.4.0\extras\ssl\cacert.pem&quot;
  openssl.cafile=&quot;C:\wamp64\bin\php\php7.4.0\extras\ssl\cacert.pem&quot;
  </code></pre>
  <p><strong>4.</strong> Restarted Wamp services and refreshed the page</p>
  <hr />
  <p>But I still get the error.
  Did I do something wrong?</p>
  <p>Thank you in advance.</p>