diff options
author | Max <michal@naiman.eu> | 2022-03-19 16:25:51 +0300 |
---|---|---|
committer | Max <michal@naiman.eu> | 2022-03-19 16:25:51 +0300 |
commit | 1c135adba2bc584e9d4d75a87af6ac6154c883ad (patch) | |
tree | 9b13f5b6f93ffba8c2237fd08ea7f61f545dc6e3 /Duplicati | |
parent | 8e176de004c075a168fd85c0932dddffe35773c5 (diff) |
TLS 1.1 deprecation and TLS 1.3 support
Diffstat (limited to 'Duplicati')
-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 90d5ab9c4..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.Tls12 | SecurityProtocolType.Tls13;
+ 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 ecaa668bb..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.Tls12 | System.Security.Authentication.SslProtocols.Tls13, 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);
|