asp.net.net-4.0windows-server-2008-r2tls1.2

TLS 1.2 in .NET Framework 4.0


I have a Windows server 2008 R2 server running a dozen .NET Framework 4.0 WebForms applications, and I need to disable TLS 1.0 and lower. When I do that, all secure connections fail and I was forced to re-enable TLS 1.0. Is there any way to use TLS 1.2 in a framework 4.0 environment? Perhaps I am missing something?

Also, due to limitations of the version CMS we are using, we cannot upgrade the Framework at this time.


Solution

  • The only way I have found to change this is directly on the code :

    at the very beginning of your app you set

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    

    you should include the system.net class

    I did this before calling a web service because we had to block tls1 too.