Question

Cannot communicate securely with peer: no common encryption algorithm(s)

Hi there, I have a question, my vps Centos 7 works fine but I recently upload a php script that allows payments with paypal via REST, unfourtnately, always receive next exception: Fatal error: Uncaught exception ‘PayPal\Exception\PayPalConnectionException’ with message ‘Cannot communicate securely with peer: no common encryption algorithm(s).’ in *****/****/paypal/paypal/rest-api-sdk-php/lib/PayPal/Core/PayPalHttpConnection.php:137

I tested the script in a couple of servers more and everything works fine, I don’t know if there’s a configuration I’m missing. Can anyone help me with this? I don’t know what can be the problem.

Greetings!


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

@luisroc

I’m not sure, but I guess PayPal maybe does a reverse check. And if they do, then yes, a self-signed certificate is not allowed. You either need to use Let’s Encrypt (which is free) or buy a certificate.

And according to checking your certificate, it states that you’re running OpenSSL/1.0.1e-fips in Apache/2.4.6, which is probably the reason why you’re getting the error, since that version of OpenSSL is old and insecure.

Hi @luisroc

Which version of PHP, cURL and OpenSSL are you using? My guess would be that that one of these libraries are outdated and using an old algorithm (SSL or TLSv1) to try to communicate with PayPal, which they don’t allow.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel