Removed code for supporting .NET < 4.8

This commit is contained in:
Kenneth Skovhede
2024-04-24 11:21:03 +02:00
parent 76addf3a9e
commit 787b2bf04f
2 changed files with 7 additions and 24 deletions
+6 -13
View File
@@ -160,21 +160,14 @@ namespace Duplicati.Server.WebServer
var server = CreateServer(options);
if (!certValid)
server.Start(listenInterface, p);
if (certValid)
{
var secProtocols = System.Security.Authentication.SslProtocols.Tls12 | System.Security.Authentication.SslProtocols.Tls13;
server.Start(listenInterface, p, cert, secProtocols, null, false);
}
else
{
var secProtocols = System.Security.Authentication.SslProtocols.Tls12;
try
{
//try TLS 1.3 (type not available on .NET < 4.8)
secProtocols = System.Security.Authentication.SslProtocols.Tls12 | (System.Security.Authentication.SslProtocols)12288;
}
catch (NotSupportedException)
{
}
server.Start(listenInterface, p, cert, secProtocols, null, false);
server.Start(listenInterface, p);
}
m_server = server;
@@ -184,17 +184,7 @@ namespace Duplicati.GUI.TrayIcon
{
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
try
{
//try TLS 1.3 (type not available on .NET < 4.8)
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | (SecurityProtocolType)12288;
}
catch (NotSupportedException)
{
}
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;
using (Connection = new HttpServerConnection(serverURL, password, saltedpassword, databaseConnection != null ? PasswordSource.Database : PasswordSource.HostedServer, disableTrayIconLogin, options))
{
using (var tk = RunTrayIcon())