When using curl to initiate an HTTPS request, the following error occurs: "SSL Certificate problem, verify that the CA cert is OK. Details: Error: 14090086: SSL routines: ssl3_get_server_certificate: Certificate verify failed"
Obviously, a problem occurs during certificate verification.
Curl can be used in the following two ways:
Method 1: Do not verify the certificate and host.
Before you execute curl_exec. Set Option
$ CH = curl_init ();
......
Curl_setopt ($ ch, curlopt_ssl_verifypeer, false );
Curl_setopt ($ ch, curlopt_ssl_verifyhost, false );
Method 2: Set a correct certificate.
The local SSL identification certificate is too old, resulting in incorrect Link error SSL certificate.
We need to download the new SSL local discriminant file.
Http://curl.haxx.se/ca/cacert.pem
Put inProgramFile directory
Add the following configuration for Curl
Curl_setopt ($ ch, curlopt_ssl_verifypeer, true );;
Curl_setopt ($ ch, curlopt_cainfo, dirname (_ file _). '/cacert. pem ');