"The request was aborted: Could not create SSL/TLS secure channel" error in Braintree
Asked Answered
J

2

5

In my local PC Braintree showing error "The request was aborted: Could not create SSL/TLS secure channel" when executing :

 var clientToken = gateway.ClientToken.generate();

I am using "Braintree-2.33.0.dll" and my target .net version is 4.5.1. I have enabled TLS 1.2.

It was working nicely three days ago. But suddenly started showing error. Many people faced same error and most of then have changed the SecurityProtocol. I dont find any way to change that from braintree. Is there any way to change

ServicePointManager.SecurityProtocol

for braintree ? or anything else I am missing or need to do ? Thanks in advance.

Jacintha answered 15/12, 2016 at 7:9 Comment(0)
A
12

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.

You need to update the .NET Braintree SDK you're using to at least version 3.1.0, the minimum version that supports TLS 1.2. Once compelete, you can validate your setup using the steps here.

On December 13, 2016, Braintree transitioned sandbox to only accept requests made using TLS 1.2+. After June 30th, 2017, Braintree will no longer officially support any requests in the production environment below TLS 1.2.

Astyanax answered 15/12, 2016 at 17:20 Comment(5)
I'm using Braintree 3.5 and getting this error in Sandbox. Do I have to change something in Web.config? - Scratch that, 3.5 was my js version, 3.0 was my SDK version. Upgrading.Whaley
yes, it's wide issue; only lib updating did not resolve it; got same on 01.01.2017 with Sandbox; looks like tls 1.3 must be enabled or install on server, etc or maybe additional server configs needed; (maybe ms added some bad security fixes, etc);Showplace
still try resolve that issue, prev. used lib. 2.27; can said it's very bad, at least braintry should notify users about that changes via emails etc, now I am little confused and don't known if my Production workable or not; and if it will broken on 31..01.2017 or not;Showplace
Did any of you find a solution? I'm experiencing the very same. I have to say, this is a rather poorly announced change on Braintree's part.Snaffle
Some NuGet messery later, updated to 3.5 and it seems to be working now.Snaffle
H
0

Setting this anywhere in your program.cs or startup.cs worked for me, even on versions greater than 3.1:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
Horned answered 25/8, 2022 at 15:52 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.