title: SSL/TLS operations failing PHP5.6 - curl-ca-bundle.crt & cacert.pem
body: <p>this has been driving me crazy for a couple of weeks now.</p>
  
  <p>I usually do my development on a CentOS 7 box, but recently i've started using Xampp on Windows 10 and using the CentOS box to commit code to &amp; client testing.</p>
  
  <p>Everything works fine on the linux box, but on Windows any SSL/TLS calls are failing, and from what I can tell it's due to the new PHP5.6 feature of verifying peer certificates and host names by default - <a href="http://php.net/manual/en/migration56.openssl.php" rel="nofollow">http://php.net/manual/en/migration56.openssl.php</a></p>
  
  <p>I've read just about every how-to guide online, and on SO, and as far as I know I've tried everything, but am getting nowhere.</p>
  
  <p>Please can someone help?!</p>
  
  <p>Extension <code>extension=php_openssl.dll</code> is enabled in php.ini, and so is <code>extension=php_curl.dll</code>.</p>
  
  <p>I've also downloaded cert files and added the following to my php.ini..</p>
  
  <pre><code>curl.cainfo = "‪C:\xampp\php\certs\curl-ca-bundle.crt"
  curl.capath = "‪C:\xampp\php\certs\"
  
  
  openssl.cafile= "‪C:\xampp\php\certs\curl-ca-bundle.crt"
  openssl.capath= "‪C:\xampp\php\certs\"
  </code></pre>
  
  <p>The errors I am getting are:</p>
  
  <p>For SMTP calls using TLS:</p>
  
  <pre><code>PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
  error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in W:\libraries\Zend\Mail\Protocol\Smtp.php on line 206
  </code></pre>
  
  <p>For cURL calls:</p>
  
  <pre><code>API call to messages/send failed: error setting certificate verify locations: CAfile: ‪C:\xampp\php\certs\cacert.pem CApath: none
  </code></pre>
  
  <p>The contents of the <code>C:\xampp\php\certs\</code> directory is:</p>
  
  <pre><code>ca-bundle.trust.crt
  cacert.pem
  curl-ca-bundle.crt
  </code></pre>
  
  <p>I have restarted Apache, and even tried using curl.exe as a standalone program in command line, which works fine requesting HTTPS domains (not sure if that is relevant, but I tried it anyway!)</p>
  
  <p>I have also tried adding the following to php.ini (and restarting Apache) which has no effect..</p>
  
  <pre><code>openssl.verify_peer= false
  openssl.verify_peer_name = false
  </code></pre>
  
  <p>Any ideas?</p>