Click here to Skip to main content
15,742,120 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My application target framework is 4.6.2 but still i am getting error while calling API as
The request was aborted: Could not create SSL/TLS secure channel
The server where my client application running is only having TLS1.2 enable and all other TLS versions are disable.
I am facing this issue from few days as previously it was working fine on my side.After certain changes done on client server [ Service which my app calling ] my application start facing this issue.
Although client application .net framework is latest e.g 4.6.2 and above still have to add below line before calling can anyone confirmed.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

What I have tried:

I have already migrated my client calling application into framework 4.6.2 but still facing issue.Is there any other changes required in application to call the service having TLS1.2 enable.
Updated 13-Feb-20 2:43am

This is a very generic error, there are many reasons why TLS/SSL negociation may fail.
c# - The request was aborted: Could not create SSL/TLS secure channel - Stack Overflow[^] contains several approaches to diagnose the real issue.
Share this answer
Transport Layer Security (TLS) best practices with the .NET Framework | Microsoft Docs[^]

.NET Framework 4.7 or later defaults to using the protocols enabled by the OS.

For .NET 4.6.x, you'll have to set the DontEnableSystemDefaultTlsVersions AppContext switch to false.

NB: The latest - and last - version of .NET Framework is 4.8:
Download .NET (Linux, macOS, and Windows)[^]

It's the last because the next release will be .NET 5, which is based on .NET Core. The .NET Framework isn't going anywhere, but aside from security patches it won't be updated again.
Introducing .NET 5 | .NET Blog[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900