Question: Website on Plesk shows: cURL error (77): Problem with the SSL CA cert
Applicable to:
Symptoms- A website or PHP scripts show the following error:
cURL error (77): Problem with the SSL CA cert (path access rights)cURL error (77): Problem with the SSL CA cert (path access rights)
Error : "error setting certificate verify locations: CAfile: C:\Program Files (x86)\Plesk\Additional\PHPSettings\cacert.pem CApath: none"
cURL error 77: error setting certificate verify locations: CAfile: /etc/ssl/certs/cacert.pem CApath: /etc/ssl/certs
- On Plesk for Windows the Extensions menu may show the following error when trying to open it:
error setting certificate verify locations: CAfile: C:\Program Files (x86)\Plesk\admin\conf\cacert.pem CApath: none
Cause
PHP cURL uses an outdated set of root certificates to verify server certificates.
Resolution Solution 1 - Using Plesk GUI1.Log in to Plesk.
2.Install Panel.ini Editor extension:
Extensions > Server Tools section > Panel.ini Editor.
3.Go to
Extensions > My Extensions > Panel.ini Editor (Go To Extension) > Editor.
4.Add records below to the editor and Save changes:
[php]
curlCertificatesUrl="http://curl.haxx.se/ca/cacert.pem"
5.Wait until Daily task is executed (It is executed once a day).
6.Go to
Domains > example.com > PHP Settings and add the line below into
Additional configuration directives. Replace path to cacert.pem with your own path.
[color=brown]curl.cainfo="C:\Program Files (x86)\Plesk\Additional\PHPSettings\cacert.pem"[/color]
If it is required to apply the changes for all the domains using a particular PHP version go to
Tools & Settings > PHP Settings> %PHP_version%, click on
php.ini tab and add the following line at the end of file:
curl.cainfo="/etc/ssl/certs/cacert.pem"
Solution 2 for Windows1.Log in to the server via RDP.
2.Download the cacert.pem file from the main curl website http://curl.haxx.se/ca/cacert.pem.
3.Open %plesk_dir%admin\conf\panel.ini file (create it from panel.ini.sample if it doesn't exist)
Note: %plesk_dir% by default is C:\Program Files (x86)\Plesk\
4.Add below directive to panel.ini.
[php]
curlCertificatesUrl="http://curl.haxx.se/ca/cacert.pem
5.Place downloaded cacert.pem to %plesk_dir%Additional\PHPSettings\ directory.
6.Wait until Daily task is executed (It is executed once a day).
Solution 2 for Linux
1.Connect to the server via SSH
2.Download the CA certificate store from the official cURL website and move it to the directory /etc/ssl/certs/:
# wget https://curl.haxx.se/ca/cacert.pem && mv cacert.pem /etc/ssl/certs/
3.Log into Plesk.
4.Go to Tools & Settings > PHP Settings > %PHP version% > php.ini.
5.Add the following line into the end of the file:
curl.cainfo="/etc/ssl/certs/cacert.pem"
6.Click OK to save the file