PayPal Sandbox API SSL handshake error suddenly started using PayPal PHP SDK?

15,298

Solution 1

Differences are between Certificate and Signature

enter image description here

Signature is the preferred way of accessing PayPal API.

Solution 2


The issue is fixed and the code has been pushed to master branch. You should see the refreshed bundles of the sdk out on x.com in the next couple of days.

Refer GitHub issue here https://github.com/paypalx/SDKs/issues/22

Thanks, Prasanna.

Solution 3

I can't answer the question but I can say that I have just discovered the same problem. I confirm that jimp's workaround of changing the SDK's service endpoint config to :

service.EndPoint="https://api-3t.sandbox.paypal.com/2.0/"

solved my issue. (This is in the Paypal SDK config/sdk_config.ini file).

In my case I am using the PHP SDK. I have not changed anything on my sandbox account. My best guess is that the original URL is simply down for a while. (Firefox shows the "Secure Connection Failed" alert).

Share:
15,298
jimp
Author by

jimp

I am the CEO and lead developer for Stack Overlap, my digital agency focused on web design and web hosting solutions.

Updated on June 04, 2022

Comments

  • jimp
    jimp almost 2 years

    Up until today, I have been successfully developing with PayPal's sandbox using the new PayPal PHP SDK which comes preconfigured to use this sandbox URL:

    https://api.sandbox.paypal.com/2.0/
    (URL in Chrome currently returns: "Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.")

    But today my webapp is crashing due to a SSL handshake failure: Uncaught exception 'PPConnectionException' with message 'error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure' in ./paypal-sdk-1.0.92/lib/PPHttpConnection.php:185

    The only event that has occurred since yesterday (when my webapp was last working) was I reset my sandbox "seller" account, which may have reset the API credentials according to this post. Since I've updated the API credentials manually, and have verified them to be correct, I cannot say if they were ever wrong at this point.

    After lots of searching, I found other web articles that say the URL should be:

    https://api-3t.sandbox.paypal.com/2.0/
    (URL in Chrome returns a SOAP response.)

    So I changed my PayPal PHP SDK's included URL from https://api.sandbox.paypal.com/2.0/ to https://api-3t.sandbox.paypal.com/2.0/ and it is working perfectly again. What happened here? Is the non-"3t" sandbox URL simply broken right now?

    EDIT: After the feedback received from @Win and @JoelP, I have filed a bug report through the PayPal SDK github so someone at PayPal can explain what changed today and fix the SDK to have the correct URL when using Signature credentials.

    EDIT 2: PayPal fixed the issue a few days ago. It's going to be available in the next release. https://github.com/paypal/SDKs/issues/22#issuecomment-8660682

    Thanks for the help everyone.

  • jimp
    jimp over 11 years
    Thank you for confirming this. I just posted a bug report to the SDK github so hopefully someone at PayPal can address the problem or update the SDK. The latest SDK still uses the non-"3t" URL.
  • jimp
    jimp over 11 years
    I see. The different URL's make sense, but it still doesn't explain why the original URL from the SDK worked fine until today. Thank you for confirming the correct configuration.
  • jimp
    jimp over 11 years
    Thanks. I got the email notification about that, and I was just coming back to post it.
  • jimp
    jimp over 11 years
    How the wrong URL ever worked in the first place is still a mystery, but your info help me solve it and realize I needed to inform the PayPal SDK dev team.
  • Robert
    Robert over 11 years
    Just to add a quick comment on "(Firefox shows the "Secure Connection Failed" alert)."; this is expected behaviour for the api.paypal.com endpoint(s). api.paypal.com expects a client (API) certificate to complete the SSL chain. Without which, it will fail the SSL validation, and thus return an error.