I currently have a problem and cannot find a strict answer.
I have ASP.NET MVC 5 for targeting 4.6.1 applications, and its goal is to work with a third-party API that is protected by the TLS 1.1 / TLS 1.2 protocols.
I tried to run the application in two environments:
- my local Windows 10 machine with .NET 4.6.2 Framework, IIS Express;
- Windows Server 2012 Server Server with .NET 4.6.1, IIS 8.0
The problem is that when starting the ServicePointManager.SecurityProtocol locally, the default value is set to Ssl3, Tls , so I can’t configure the target API and have to encode it when the application starts to use TLS 1.1 / TLS 1.2: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 .
When the application runs on the server, the default value of ServicePointManager.SecurityProtocol set to Tls, Tls11, Tls12 , so it works well.
According to documentation applications running in the .NET Framework 4.6 or later, you must use TLS 1.1 / TLS 1.2 by default, as is done on the remote machine.
Why are the default values of ServicePointManager.SecurityProtocol different? Is this because of the .NET Framework configuration? Or maybe registry settings? I looked through it, but could not find the answer.
source share