I was testing the paypal API for a website I'm making. Everything was working fine last night, but when I ran it again today, I received the following error:
Could not establish secure channel for SSL/TLS with authority 'api-aa.sandbox.paypal.com'
In Sandbox mode, the PayPal gateway functions exactly the same as in Live Mode except transactions do not involve real money. To run sandbox mode you'll need a developer account from https://developer.paypal.com.
The PayPal sandbox is a self-contained, virtual testing environment that simulates the live PayPal production environment. The sandbox provides a shielded space where you can initiate and watch while your apps process PayPal API requests without touching any live PayPal accounts.
Log in to your sandbox PayPal account. Go to Settings (Gear Icon) > Account Settings > API Access. Select NVP/SOAP API integration (Classic) > Manage API Credentials > Request API Signature. You can find API Username, API Password, and API Signature.
Had the same. Try to use http://api-3t.sandbox.paypal.com/ instead. It helped me. I found it here: setExpressCheckout and SSL/TLS error
If you don't have or are not using an API certificate, you should connect to api-3t.paypal.com or api-3t.sandbox.paypal.com for Live or Sandbox respectively.
I have been battling this same issue for several hours now; After writing the PayPal Express checkout integration using the SOAP API with Signing over year ago it was put on the back burner (all unit test passing at the time). I come back to it today to the error:
Could not establish secure channel for SSL/TLS with authority 'api-3t.sandbox.paypal.com'
After much research I have isolated the issue in our instance being down to the default ServicePointManager.SecurityProtocol
value being System.Net.SecurityProtocolType.Ssl3 | System.Net.SecurityProtocolType.Tls
, updating this to SecurityProtocolType.Tls12
fixed the issue.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With