I got TLS 1.0 disabled. So we are trying to use TLS 1.2 in our .Net application which is using .Net Framework 4.0.
I have added the code for this at the start
System.Net.ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
It works perfectly on my local system.
But i am not sure why its not working when I deploy the code on server (Windows Server 2008 R2). I checked everything. .Net framework is present on server. But still its giving the same issue on server only.
Is there anything I'm missing here?
According to this post:
So basically you need to upgrade your server to
.Net 4.5
to enableTLS 1.2
.Also, you can simplify your code and make it more readable:
Related MSDN articles:
SecurityProtocolType
enum for .Net 4.0 (noTls12
member here)SecurityProtocolType
enum for current .Net