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

Become a contributor for community

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

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.