2

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.

  • if you have normal setup, not chrooted, then you need to run "yum update" see if anything comes up like nss* package, install all updates and reboot – MagenX Oct 27 '15 at 19:22
  • @MagenX Thanks, I will try this. but when I try to execute a YUM command in SSH, I receive a warning saying "use YUM at your own risk". Are you sure it is safe to use YUM? – SBALT Oct 27 '15 at 21:26
  • this is just impossible , yum is the package manager, you must use it. Yum is an automatic updater and package installer/remover for rpm systems. It automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain groups of machines without having to manually update each one using rpm. Yum has a plugin interface for adding simple features. Yum can also be used from other python programs via its module inteface. – MagenX Oct 28 '15 at 7:56
  • @MagenX I understand, and yet when I execute yum check-update, I receive this warning: Using yum can damage your system. To use yum at your own risk. Use /usr/bin/yum check-update. So I guess I will have to figure out this issue before proceeding with the Paypal problem... – SBALT Oct 28 '15 at 16:25
4

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.

0

Updating everything did not fixed my issue. I've been trying to fix it in a sane manner for 2 hours. My final temporary fix is the following.

I had to go into /lib/PayPal/Core/PayPalHttpConnection.php and add:

curl_setopt($ch, CURLOPT_CAINFO, '/etc/pki/tls/cert.pem');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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