mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Check for Mono legacy TLS
This commit is contained in:
@@ -153,5 +153,32 @@ namespace Jackett.Server
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void CheckEnvironmentalVariables(Logger logger)
|
||||
{
|
||||
//Check the users environmental variables to ensure they aren't using Mono legacy TLS
|
||||
|
||||
var enumerator = Environment.GetEnvironmentVariables().GetEnumerator();
|
||||
while (enumerator.MoveNext())
|
||||
{
|
||||
if (enumerator.Key.ToString().Equals("MONO_TLS_PROVIDER", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
logger.Info("MONO_TLS_PROVIDER is present with a value of: " + enumerator.Value.ToString());
|
||||
|
||||
if (enumerator.Value.ToString().IndexOf("legacy", StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
{
|
||||
logger.Error("The MONO_TLS_PROVIDER=legacy environment variable is not supported, please remove it.");
|
||||
Environment.Exit(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (enumerator.Key.ToString().IndexOf("MONO_", StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
{
|
||||
logger.Info($"Environment variable {enumerator.Key} is present");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user