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.
I code in VB and was able to add the following line to my Global.asax.vb file inside of Application_Start
If you are not able to add a property to
system.net
class library.Then, add in Global.asax file:
And you can use it in a function, at the starting line:
And, it's being useful for
STRIPE
payment gateway, which only supports TLS 1.1, TLS 1.2.EDIT: After so many questions on .NET 4.5 is installed on my server or not... here is the screenshot of
Registry
on my production server:I have only .NET framework 4.0 installed.
According to this, you will need .NET 4.5 installed. For more details, visit the webpage. The gist of it is that after you have .NET 4.5 installed, your 4.0 apps will use the 4.5 System.dll. You can enable TLS 1.2 in two ways:
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319: SchUseStrongCrypto
toDWORD 1
The only way I have found to change this is directly on the code :
at the very beginning of your app you set
you should include the
system.net
classI did this before calling a web service because we had to block tls1 too.
I meet the same issue on a Windows installed .NET Framework 4.0.
And I Solved this issue by installing .NET Framework 4.6.2.
Or you may download the newest package to have a try.
Make the following changes in your Registry and it should work:
1.) .NET Framework strong cryptography registry keys
2.) Secure Channel (Schannel) TLS 1.2 registry keys