TLS1.2 support in .Net framework

If application was compiled with .NET Framework 4.5.2 or lower Framework, then by default ServicePointManager.SecurityProtocol is initialized to SecurityProtocolType.Ssl3  Or SecurityProtocolType.Tls (SSL 3.0 and TLS 1.0 only). So it won't be able to connect to a remote server that requires TLS 1.2.

There are several ways to allow your client application to use TLS 1.2:

Recompile your client application against .NET Framework 4.6 or later.
In Visual Studio, open your project's property pages, go to the Application tab, and change the Target Framework. like below



On the client machine, run RegEdit.exe, go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ .NETFramework\v4.0.30319
 and add a DWORD (32-bit) value named SchUseStrongCrypto, and set it to 1. (This flag causes ServicePointManager.SecurityProtocol to be initialized to Tls | Tls11 | Tls12.) like below



When your client application starts up, turn on TLS 1.2: ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;

There's no need to regenerate your proxy class because it's not responsible for negotiating the TLS protocol or cipher.

Comments

Popular posts from this blog

Email Sending through O365 using OAuth Protocol

IISRESET vs App Pool Recycling ?

Deploy .Net6.0 Web api with docker