On Redhat Linux, in a PHP script I am setting cURL options as such:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, True);
curl_setopt($ch, CURLOPT_CAINFO, '/home/andrew/share/cacert.pem');
Yet I am getting this exception when trying to send data
(curl error: 77) error setting certificate verify locations:
CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
Why is it looking for the CAfile in /etc/pki/tls/certs/ca-bundle.crt
? I don't know where this folder is coming from as I don't set it anywhere.
Shouldn't it be looking in the place I specified, /home/andrew/share/cacert.pem
? I don't have write permission /etc/
so simply copying the file there is not an option. Am I missing some other curl option that I should be using?
(This is on shared hosting - is it possible that it's disallowing me from setting a different path for the CAfile?)
Try Replacing CURLOPT_CAINFO with CURLOPT_CAPATH.
And also take a look at SSLCERT option.