Reply
Member
Posts: 6
Registered: ‎07-17-2017

System.Net.WebException The underlying connection was closed: An unexpected error occurred on a send

I use C# examples and use the source code for CreateCustomerProfile: http://developer.authorize.net/api/reference/#customer-profiles

 

I use only code from this example and I have the exception "System.Net.WebException" in string

controller.Execute();

 

Can anyone help me? 

Highlighted
Posts: 138
Topics: 0
Kudos: 27
Blog Posts: 0
Ideas: 0
Solutions: 9
Registered: ‎04-28-2017

Re: System.Net.WebException The underlying connection was closed: An unexpected error occurred on a

What version of the .Net framework are you using? If you are using .Net framework 4.5, 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
Member
Posts: 6
Registered: ‎07-17-2017

Re: System.Net.WebException The underlying connection was closed: An unexpected error occurred on a

Thank you very much!))) Your additional code has helped me. I use .NET framework 4.5.2

Posts: 138
Topics: 0
Kudos: 27
Blog Posts: 0
Ideas: 0
Solutions: 9
Registered: ‎04-28-2017

Re: System.Net.WebException The underlying connection was closed: An unexpected error occurred on a

Very good. You are welcome.
Powered by NexWebSites.com -
Certified Authorize.net developers