Reply
Highlighted
Member
Posts: 2
Registered: ‎06-12-2017

C# Sample Does not work in Sandbox now that TLS setings have been changed

I have Windows 2012 server and I have gone into the regersity and have disabled TLS 1.0 and TLS 1.1. 

When I run the C# sample that charges credit card. I get the following error on the lines

 

try
{
controller.Execute();
}
catch (Exception mm)
{
Console.WriteLine("Error: " + mm.Message);
}

 

I get an exception error:  the underlying connection was  closed: An unexpected error occurred on a send.

 

Does anyone have any ideas why I am getting this error?

 

 

 

 

 

Highlighted
Posts: 459
Topics: 0
Kudos: 92
Blog Posts: 0
Ideas: 0
Solutions: 36
Registered: ‎04-28-2017

Re: C# Sample Does not work in Sandbox now that TLS setings have been changed

[ Edited ]

Try : 

 System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

 in your function that posts the XML.

Powered by NexWebSites.com -
Certified Authorize.net developers