cancel
Showing results for 
Search instead for 
Did you mean: 

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?

 

 

 

 

 

1 REPLY 1

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
NexusSoftware
Trusted Contributor