Fixed: Disable SSL when migrating from v3

Closes #5979
This commit is contained in:
Mark McDowall 2023-11-18 17:47:02 -08:00 committed by Mark McDowall
parent c922cc5dc6
commit d95660d3c7
1 changed files with 15 additions and 0 deletions

View File

@ -339,6 +339,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() private void DeleteOldValues()
{ {
var xDoc = LoadConfigFile(); var xDoc = LoadConfigFile();
@ -410,6 +424,7 @@ namespace NzbDrone.Core.Configuration
public void HandleAsync(ApplicationStartedEvent message) public void HandleAsync(ApplicationStartedEvent message)
{ {
MigrateConfigFile();
EnsureDefaultConfigFile(); EnsureDefaultConfigFile();
DeleteOldValues(); DeleteOldValues();
} }