cancel
Showing results for 
Search instead for 
Did you mean: 

Sandbox is giving SSL/TLS Error

Hi, I'm trying to use the C# coffe shop sample site, it load up fine, but when I go to process an order I get this error:

"System.Net.WebException: 'The request was aborted: Could not create SSL/TLS secure channel.'"

 

From what I understand this could have something to do with TLS 1.2, but I'm having a diffiuclt time believing that Authorize.NET wouldn't update their developer samples. Any help is appreciated.

epicbooth212
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @epicbooth212,

  

You're right, this is a common issue. I have submitted a pull request 16 days ago https://github.com/AuthorizeNet/sample-code-csharp/pull/65

 

The gist of it is to use the following before making your webrequest: 

 const SslProtocols _Tls12 = (SslProtocols)0x00000C00;
 const SecurityProtocolType Tls12 = (SecurityProtocolType)_Tls12;
 ServicePointManager.SecurityProtocol = Tls12;

 

Powered by NexWebSites.com -
Certified Authorize.net developers

View solution in original post

NexusSoftware
Trusted Contributor
2 REPLIES 2

Hi @epicbooth212,

  

You're right, this is a common issue. I have submitted a pull request 16 days ago https://github.com/AuthorizeNet/sample-code-csharp/pull/65

 

The gist of it is to use the following before making your webrequest: 

 const SslProtocols _Tls12 = (SslProtocols)0x00000C00;
 const SecurityProtocolType Tls12 = (SecurityProtocolType)_Tls12;
 ServicePointManager.SecurityProtocol = Tls12;

 

Powered by NexWebSites.com -
Certified Authorize.net developers
NexusSoftware
Trusted Contributor

  

You're right, this is a common issue. I have submitted a pull request 16 days ago https://github.com/AuthorizeNet/sample-code-csharp/pull/65

 

The gist of it is to use the following before making your webrequest: 

 const SslProtocols _Tls12 = (SslProtocols)0x00000C00;
 const SecurityProtocolType Tls12 = (SecurityProtocolType)_Tls12;
 ServicePointManager.SecurityProtocol = Tls12;

 

 

Yep, that did the trick! Added it right at the top of the SendRequest method.

 

One thing to note is you'll need to use the "System.Security.Authentication" namespace in your using statments or add prepend it to the SslProtocols objects.