cancel
Showing results for 
Search instead for 
Did you mean: 

TLS 1.2 Issue -tetsing on sandbox

I'm trying to create some test transactions on sandbox. I have IIS 10.0 express and .net 4.6 and i got the error saying that the existing connection was forcibly closed by the remote host. Do we have to do any code changes to fix this?

smitham
Member
7 REPLIES 7

Try adding the following at the beginning of the function where you make a webrequest:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
Powered by NexWebSites.com -
Certified Authorize.net developers
NexusSoftware
Trusted Contributor

Sorry this did not help.

smitham
Member
Although you may have .Net 4.6 installed, what version are you targeting in your application?
Powered by NexWebSites.com -
Certified Authorize.net developers

I think it is targeting 4.0. I cannot use SecurityProtocolType.Tls12 and SecurityProtocolType.Tls11. I can only use SecurityProtocolType.Tls and which is TLS 1.0 so it cannot connect

 

smitham
Member

Target >net Framework 4.5

Post the code you are using to make the request.
Powered by NexWebSites.com -
Certified Authorize.net developers

It got fixed with this code

 

const SslProtocols _Tls12 = (SslProtocols)0x00000C00;

const SecurityProtocolType Tls12 = (SecurityProtocolType)_Tls12;

ServicePointManager.SecurityProtocol = Tls12;