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

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

by Md Ziaoul Hoque -
Number of replies: 0

I have an certificate verify error in carl. Do anyone have any idea how to resolve the issue?

The error looks like this:

------------------------------------------------------------
2014-10-23 0:12:31 +0000 - ERROR -->
------------------------------------------------------------
Curl Error: error setting certificate verify locations:
  CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
------------------------------------------------------------

This error is related to Turnitin Assignment 2 (Version: 2014012403). Turnitin Account ID, Turnitin Shared Key, Turnitin API URL setting are ok. But it has a connection error.

Could not connect to Turnitin. Double check your API URL setting.

I have contacted to Turnitin Support. They advice to update following? Do anyone has any idea; how to resolve this issue in Godaddy cpanel shared hosting?

If you encounter connectivity issues while using the Turnitin Moodle Direct V2 integration (error: Turnitin API Base URL incorrect or unavailable, or error: Double check your API URL setting) this could be related to a CA certificate being unavailable to cURL. Viewing the Turnitin Apilog files will identify if this is the case.

The Moodle Direct plugin uses the server operating system's implementation of cURL. If cURL has an out of date (or no) CA certificates, the interaction with Turnitin will fail due to cURL performing peer SSL certificate verification and not being able to verify the Turnitin SSL certificate.  Until cURL 7.18.0 some CA certificates were provided, but after 7.18.0 no CA certificates have been provided at all. Because of this, the Moodle server administrator would need to ensure that an up to date CA certificate bundle is used.

For Debian and RedHat based distributions:
CA certificates are distributed in the ca-certificates package. Gentoo servers provide them via the app-misc/ca-certificates ebuild. It's also a good idea to make sure that the OpenSSL libraries (libssl) and cURL libraries (libcurl) are up to date on your server.

You will also need to place a file with the Bundle of CA Root Certificates (downloadable from http://curl.haxx.se/ca/cacert.pem) on your webserver and make a curl.cainfo reference to this file in your php.ini.

Average of ratings: -