How to fix the Curl Error: error setting certificate verify locations

Today I had a new server running CentOS5 have trouble with a known good authorize.net library using curl.  It was producing the following error:

error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none

After some research I found it was based on the inability for the apache user to access the ca-bundle.crt file. You will find solutions on the web suggesting adding curl_setopt($link, CURLOPT_SSL_VERIFYPEER, FALSE); to your script to disable the peer verification — I suggest you not do this and simply fix the permissions for your CA file.

Execute this:

/bin/chmod 755 /etc/pki/tls/certs

Solved!

2 Comments so far »

  1. Chris Jones said

    October 29 2009 @ 11:46 am

    Hello,

    I am having issues with this error:
    Error: Cannot execute request: error setting certificate verify locations:
    CAfile: /Applications/MAMP/htdocs/certification.cer
    CApath: none

    I’ve tried permissions. On my Mac 10.5 I can change the permissions for 755 to read and write. on Mac 10.4 I cannot. I used terminal. and inputed this:
    /bin/chmod 755 /Applications/MAMP/htdocs/certification.cer

    is this the write code? I also created a file with the cer at the end of the name as shown upbove. Is this permitted?

    any help would be very appreciated.

    I am working on Wordpress page running MAMP using LocalHost to edit page

    thanks

    Chris

  2. Dale said

    November 2 2009 @ 2:16 pm

    Thank you, saved me a bunch of time fighting CentOS!

Comment RSS · TrackBack URI

Leave a comment

Name: (Required)

Email: (Required)

Website:

Comment: