ssl - Certificate CA bundle file: PEM - PHP/cURL - Local install..? -


i'm using windows server 2008 r2 (with iis), php 5.6.0 , curl 7.36.0 test against paypal's tls test url:

$ch = curl_init(); curl_setopt($ch, curlopt_url, 'https://tlstest.paypal.com'); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_failonerror, true); curl_setopt($ch, curlopt_ssl_verifypeer, true); curl_setopt($ch, curlopt_sslversion, 6); // curl_sslversion_tlsv1_2 curl_setopt($ch, curlopt_cainfo, dirname(__file__) . '\cacert.pem'); $result = curl_exec($ch); curl_close($ch); 

when use curlopt_cainfo , cacert.pem http://curl.haxx.se/docs/caextract.html works , get:

paypal_connection_ok

when don't use curlopt_cainfo error:

ssl certificate problem: unable local issuer certificate

i've tried this:

  1. mmc
  2. file > add/remove snap-in
  3. certificates (local computer)
  4. trusted root certification authorities > certificates
  5. all tasks > import
  6. select cacert.pem
  7. message: "the import successful"

however has made no difference, still have use curlopt_cainfo work.

is there way can install these root certificates on our windows server don't have use curlopt_cainfo , cacert.pem every call make..?

you can leverage php.ini set absolute path of cacert.pem located.

the directive curl.cainfo

set it, or @ least read value , place file @ right position.

see: http://php.net/manual/en/curl.configuration.php


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -