I have .NET 4.5.2 application that is using SmtpClient
to send emails. The application is installed on Windows 2012 R2 server. When I disable TLS 1 and TLS 1.1 and enable only TLS 1.2, the application stops sending mails. I think that's because .NET 4.5.2 does not support v1.2.
I am thinking of the following steps
1>Disable TLS 1 and TLS 1.1 and enable only TLS 1.2 on Windows Server.
2>Install .NET 4.8 on Windows Server.
3>Change target framework of the application to 4.8 (in csproj and web.config) and recompile.
4>Deploy application.
Questions
Based on the documentation Starting with .NET Framework 4.7.1, WCF defaults to the operating system configured version
1>Is this true only for WCF or will SMTP also defaults to operating system configured version?
2>or do I need to set version explicitly like System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
3>Is it possible to set the version TLS 1.2 right now, and when in future TLS 1.3 is available app should automatically defaults to TLS 1.3? (Without changing the code again)