title: iOS cURL: unable to get local issuer certificate
body: <p>I'm trying to setup secure connection to HTTPS server with curl on iOS (app is written in C++)</p>
  
  <p>I figured out that I need to set cacert.pam (<a href="http://curl.haxx.se/ca/cacert.pem" rel="nofollow">http://curl.haxx.se/ca/cacert.pem</a>) file path for CURLOPT_CAPATH option:</p>
  
  <pre><code>curl_easy_setopt (curl, CURLOPT_CAPATH, "/var/mobile/Applications/811DEF2E-DE1D-4C86-A1FD-129478C8318D/MyApp.app/ca/cacert.pem");
  curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1L);
  curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 2L);
  </code></pre>
  
  <p>But this just generates folowing verbose log (ip and url changed):</p>
  
  <pre><code>libcurl/7.29.0 OpenSSL/1.0.1e zlib/1.2.5
  * About to connect() to myserver.com port 443 (#0)
  *   Trying 128.128.128.128...
  * Connected to myserver.com (128.128.128.128) port 443 (#0)
  * successfully set certificate verify locations:
  *   CAfile: none
    CApath: /var/mobile/Applications/171CA93F-15F2-42A1-938B-01812AF1E555/MyApp.app/ca/cacert.pem
  * SSL certificate problem: unable to get local issuer certificate
  * Closing connection 0
  </code></pre>
  
  <p>Same happens if I set CURLOPT_CAPATH to "../MyApp.app/ca" folder. File exists and can be read.</p>
  
  <p>There seems to be a lack of information about this error.. 
  What I am doing wrong?</p>