title: CodeIgniter-cURL on self assign certificate
body: <p>Im using codeigniter-curl extension (<a href="https://github.com/philsturgeon/codeigniter-curl" rel="nofollow noreferrer">https://github.com/philsturgeon/codeigniter-curl</a>) to call API that return Json format data.</p>
  
  <p>a simple code it will return the result etc </p>
  
  <pre><code>$this-&gt;curl-&gt;simple_get(http://example.com/Json/GetHotDealRedemptionProduct?APIid=888ef4d078ca&amp;Language=en&amp;hash=3709aa6e0efe3c95e955a1981118027a2fde0eddc216b4049e6559af55f50458);
  </code></pre>
  
  <p>everything seem ok until the URL changed to HTTPS.</p>
  
  <p>In order to call SSL url (self signed certificate), i added these few line above my $this->curl->simple_get.... code.</p>
  
  <pre><code>$this-&gt;curl-&gt;create($this-&gt;url);
  $this-&gt;curl-&gt;ssl(true, 2, 'assets/AIMS-BSN-WEB01.crt'); 
  </code></pre>
  
  <p>the cacert.pem i saved from the firefox certificate viewer and place it in my web directory. reference: <a href="http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/" rel="nofollow noreferrer">http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/</a></p>
  
  <p>and i get this error.</p>
  
  <pre><code>error code: 60
  SSL certificate problem: unable to get local issuer certificate
  </code></pre>
  
  <p>i've searched the answer for a day long, </p>
  
  <ol>
  <li><p>changed the php.ini setting <a href="https://stackoverflow.com/questions/11910697/amazon-s3-on-wamp-localhost-ssl-error">Amazon S3 on wamp localhost SSL error</a></p></li>
  <li><p>put false for CURLOPT_SSL_VERIFYPEER. it return <code>SSL: certificate subject name 'AIMS-BSN-WEB01' does not match target host name 'api.example.com'</code></p></li>
  </ol>
  
  <p>all these are not working.</p>