diff --git a/Duplicati.Library.RestAPI/WebServer/Server.cs b/Duplicati.Library.RestAPI/WebServer/Server.cs index 189b69c4b..a6922b4e2 100644 --- a/Duplicati.Library.RestAPI/WebServer/Server.cs +++ b/Duplicati.Library.RestAPI/WebServer/Server.cs @@ -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; diff --git a/Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs b/Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs index ec0d5f528..2493ea3f5 100644 --- a/Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs +++ b/Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs @@ -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())