Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?)

share|improve this question

1 Answer 1

Try Replacing CURLOPT_CAINFO with CURLOPT_CAPATH.

And also take a look at SSLCERT option.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.