Magento-1.9 – Fix PayPal NVP CURL Connection Error #77

errormagento-1.9paypalpaypal-expressssl

I am running Magento CE 1.9.0.1. So far I have been using Paypal Integral but now need to switch to Paypal Express Checkout (to handle recurring profiles). So I have activated Paypal Express Checkout in Magento Admin and filled in my Paypal API signature.

But when customers try to proceed to checkout, they see the following error message: Unable to communicate with the PayPal gateway.

In /var/log/exception.log I can see the following error message:

exception 'Exception' with message 'PayPal NVP CURL connection error #77: Problem with the SSL CA cert (path? access rights?)' in /app/code/core/Mage/Paypal/Model/Api/Nvp.php:983
Stack trace:
#0 /app/code/core/Mage/Paypal/Model/Api/Nvp.php(616): Mage_Paypal_Model_Api_Nvp->call('SetExpressCheck...', Array)
#1 /app/code/core/Mage/Paypal/Model/Express/Checkout.php(381): Mage_Paypal_Model_Api_Nvp->callSetExpressCheckout()
#2 /app/code/core/Mage/Paypal/Controller/Express/Abstract.php(108): Mage_Paypal_Model_Express_Checkout->start('https://www.tic...', 'https://www.tic...', false)
#3 /app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Paypal_Controller_Express_Abstract->startAction()
#4 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('start')
#5 /app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#6 /app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#7 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#8 /index.php(87): Mage::run('', 'store')
#9 {main}

Following some recommendations I found on the web, I tried to restart Apache, to disable "Enable SSL verification" in Admin… but nothing has changed.

And yet, I do have a valid SSL certificate, so my only guesses are:

  1. either Paypal does not look for my SSL certificate in the right directory — but I do not know how to check / fix that;
  2. or I should change the SSL certificate files' permissions in Filezilla?

Your help will be much appreciated! Thanks in advance.

PD: using CentOS Linux 6.5.

Best Answer

Problem solved.

Short version

As suggested by @MagenX, if you have no other bugs like I did, you should get rid of the cURL error #77 with a simple /usr/bin/yum check-update — or yum check-update depending on your configuration.

Detailed version

In my case, I had to solve other issues that were related to the original one, so I will relate the whole process in case someone faces the same situation one day.

When I ran /usr/bin/yum check-update, there was an error:

Error*: Cannot retrieve metalink for repository: epel. Please verify its path and try again.

To fix this, I followed this answer and executed /usr/bin/yum --disablerepo=epel -y update ca-certificates. At that point, I faced yet another error message:

error: rpmts_HdrFromFdno: Entête V3 RSA/SHA1 Signature, key ID c105b9de: BAD

Problem opening package ca-certificates-2015.2.4-65.0.1.el6_6.noarch.rpm

There, I followed the recommandations of this thread and that one. In other words, I executed the following commands:

  • wget http://vault.centos.org/6.6/updates/x86_64/Packages/nss-softokn-freebl-3.14.3-19.el6_6.x86_64.rpm
  • rpm2cpio nss-softokn-freebl-3.14.3-19.el6_6.x86_64.rpm | cpio -idmv
  • cp ./lib64/libfreeblpriv3.* /lib64
  • /usr/bin/yum check-update

And (for) now Paypal Express Checkout works just fine.

Related Topic