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.

hasnayn
  • 356
  • 4
  • 22

2 Answers2

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.

Justin
  • 1,310
  • 3
  • 18
  • 29
Shea
  • 886
  • 6
  • 12
  • 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. – tofutim Dec 21 '16 at 10:12
  • 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); – user1005462 Jan 13 '17 at 09:48
  • 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; – user1005462 Jan 13 '17 at 09:55
  • 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. – Ran Sagy Feb 27 '17 at 14:19
  • Some NuGet messery later, updated to 3.5 and it seems to be working now. – Ran Sagy Feb 27 '17 at 14:34
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
Edgaras
  • 449
  • 3
  • 14