Error when using curl to initiate an HTTPS request: "SSL certificate problem, verify that the CA cert is OK. Details:error:14090086:ssl routines:SSL3_GET_SERVER_CERTIFICATE:certificate Verify Failed "
Obviously, there was a problem validating the certificate.
There are 2 ways to use curl if the HTTPS request that you want to initiate is normal:
Method one, set to No authentication certificate and host.
Before Curl_exec () is executed. SET option
$ch = Curl_init ();
......
curl_setopt ($ch, Curlopt_ssl_verifypeer, FALSE);
curl_setopt ($ch, Curlopt_ssl_verifyhost, FALSE);
Method Two, set a correct certificate.
The local SSL discriminant certificate is too old to cause the link error SSL certificate to be incorrect.
We need to download a new SSL local discriminant file
Http://curl.haxx.se/ca/cacert.pem
Put it in the Program Files directory
Curl adds the following configuration
curl_setopt ($ch, curlopt_ssl_verifypeer,true);
curl_setopt ($ch, Curlopt_cainfo,dirname (__file__). ' /cacert.pem ');
Done
Some parameters of the Curl Method curl_setopt () function in PHP
Http://blog.sina.com.cn/s/blog_40e4b5660100sxa3.html
The above information for reference
This article is from the "happy Programming _ Endless" blog, please be sure to keep this source http://happyliu.blog.51cto.com/501986/1610974
Considerations when PHP initiates HTTPS (SSL) requests using curl