From 7fa4daae9b6cc47bb69f6b60429177a6fd02095b Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 18 Nov 2023 17:47:02 -0800 Subject: [PATCH] Fixed: Disable SSL when using the removed SslCertHash configuration (cherry picked from commit d95660d3c78d1ee11a7966d58e78a82a8df01393) --- .../Configuration/ConfigFileProvider.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs index c2731e084..a7b78fd92 100644 --- a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs +++ b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs @@ -325,6 +325,20 @@ namespace NzbDrone.Core.Configuration } } + public void MigrateConfigFile() + { + if (!File.Exists(_configFile)) + { + return; + } + + // If SSL is enabled and a cert hash is still in the config file disable SSL + if (EnableSsl && GetValue("SslCertHash", null).IsNotNullOrWhiteSpace()) + { + SetValue("EnableSsl", false); + } + } + private void DeleteOldValues() { var xDoc = LoadConfigFile(); @@ -396,6 +410,7 @@ namespace NzbDrone.Core.Configuration public void HandleAsync(ApplicationStartedEvent message) { + MigrateConfigFile(); EnsureDefaultConfigFile(); DeleteOldValues(); }