Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

REST calls to Sandbox fail with SSL connect error on RHEL 6 without TLSv1.2 #474

Closed
omarkilani opened this issue Jan 20, 2016 · 11 comments
Closed
Labels

Comments

@omarkilani
Copy link

Hey PayPal,

I'm unable to connect to api.sandbox.paypal.com without setting:

CURLOPT_SSLVERSION => 6

(Instead of 1 as it currently is)

api.paypal.com works fine.

Is this a known issue?

@tobeorla
Copy link
Contributor

This is happening to me too.
Having: {"paypal/rest-api-sdk-php" : "v1.6.3",}

I forked this SDK yesterday and it was working fine. Now it doesn't :S
P.S: Applying @omarkilani change on PayPalHttpConfig.php works..

@randstraw
Copy link

https://www.paypal-knowledge.com/infocenter/index?page=content&id=FAQ1914&expand=true&locale=en_US

After January 19-20
The Sandbox endpoints will only allow TLS 1.2 and HTTP/1.1 connections

@tobeorla
Copy link
Contributor

Thanks for the info @pp-randy , what should we do? I ran the test and says it's ok:

  1. SUCCESS: Your server supports TLS protocols required for secure connection to PayPal Servers.
  • Current Curl Version: 7.22.0
  • Current OpenSSL Version:OpenSSL/1.0.1

tobeorla added a commit to tobeorla/PayPal-PHP-SDK that referenced this issue Jan 20, 2016
@juwlee
Copy link

juwlee commented Jan 20, 2016

@tobeorla please see here. You might need to upgrade your openssl, curl, and re-link or recompile php so it could use openssl that supports TLS 1.2

@tobeorla
Copy link
Contributor

I don't think so:
PayPal_Connection_OKbool(true)

@jaypatel512
Copy link
Contributor

I will accept the PR from @tobeorla and make a release with minor version. Updating your SDK should solve your issue. However, if for any reason, you are not ready to make the change, and want to enable PayPal again, you can follow the step shown in sample/bootstrap.php.

Adding below lines to your bootstrap location, before making a call should allow you to override the default curl options in the SDK. Optionally, you can do the same if you are using sdk_config.ini.

PayPalHttpConfig::$defaultCurlOptions[CURLOPT_SSLVERSION] = CURL_SSLVERSION_TLSv1_2;

Above code should automatically update the curl version to TLSv1.2 which is now required for sandbox.

@jaypatel512
Copy link
Contributor

Made a release v1.6.4 with proper fix.

@kenjohnson
Copy link

@jaypatel512,
I don't think this fix will work for everyone.
The fix will update curl okay, but that won't help
if the user is running openssl that is below NSS 3.15.
See my comments on the following issue.
PAY request returns SSL connect error paypal/adaptivepayments-sdk-php#64
Those people running openssl below NSS 3.15 are in real trouble now.

@kenjohnson
Copy link

@jaypatel512, @juwlee,@pp-randy
We upgraded our openssl to OpenSSL/1.0.1,
and that solved the problem, like @juwlee
suggested. Now we can make payment.
Thanks.

@mahmoudgabrweb
Copy link

Hi,
i have a problem in paypal on server ... it works in localhost but doesn't work on the server
error message :
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure'

@xiaoleih41
Copy link
Contributor

@MhmudHsham I am locking this conversation, please open a new issue with your debug Id.

@paypal paypal locked and limited conversation to collaborators Jun 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants