diff options
author | Kenneth Skovhede <kenneth@hexad.dk> | 2022-06-12 21:59:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-12 21:59:03 +0300 |
commit | 6ca25d3e7395fcdefb651691f6adaba669c3760e (patch) | |
tree | 10e6ef5c6f736a2ff792449bb60f36ac8af6856d | |
parent | 2fabbe6046a2c05428eaedf6907b9f40fcbd4161 (diff) | |
parent | 1c135adba2bc584e9d4d75a87af6ac6154c883ad (diff) |
Merge pull request #4694 from mnaiman/patch-1
TLS 1.1 deprecation and TLS 1.3 support webserver and TrayIcon
-rw-r--r-- | Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs | 11 | ||||
-rw-r--r-- | Duplicati/Server/WebServer/Server.cs | 16 |
2 files changed, 24 insertions, 3 deletions
diff --git a/Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs b/Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs index 31b4025d9..8fe01e451 100644 --- a/Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs +++ b/Duplicati/GUI/Duplicati.GUI.TrayIcon/Program.cs @@ -225,7 +225,16 @@ namespace Duplicati.GUI.TrayIcon {
try
{
- System.Net.ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
+
+ try
+ {
+ //try TLS 1.3 (type not available on .NET < 4.8)
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | (SecurityProtocolType)12288;
+ }
+ catch (NotSupportedException)
+ {
+ }
using (Connection = new HttpServerConnection(serverURL, password, saltedpassword, databaseConnection != null ? PasswordSource.Database : PasswordSource.HostedServer, disableTrayIconLogin, options))
{
diff --git a/Duplicati/Server/WebServer/Server.cs b/Duplicati/Server/WebServer/Server.cs index 0ab45ba54..e9d5396e5 100644 --- a/Duplicati/Server/WebServer/Server.cs +++ b/Duplicati/Server/WebServer/Server.cs @@ -158,11 +158,23 @@ namespace Duplicati.Server.WebServer // so we create a new server for each attempt
var server = CreateServer(options);
-
+
if (!certValid)
server.Start(listenInterface, p);
else
- server.Start(listenInterface, p, cert, System.Security.Authentication.SslProtocols.Tls11 | System.Security.Authentication.SslProtocols.Tls12, null, false);
+ {
+ 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);
+ }
m_server = server;
m_server.ServerName = string.Format("{0} v{1}", Library.AutoUpdater.AutoUpdateSettings.AppName, System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
|