mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
ignore cert errors in linux http://www.mono-project.com/FAQ:_Security
This commit is contained in:
parent
aa50be076c
commit
e0bf68123d
6 changed files with 35 additions and 3 deletions
27
NzbDrone.Common/Security/IgnoreCertErrorPolicy.cs
Normal file
27
NzbDrone.Common/Security/IgnoreCertErrorPolicy.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using NLog;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
|
||||
namespace NzbDrone.Common.Security
|
||||
{
|
||||
public static class IgnoreCertErrorPolicy
|
||||
{
|
||||
private static readonly Logger Logger = LogManager.GetLogger("CertPolicy");
|
||||
|
||||
public static void Register()
|
||||
{
|
||||
if (OsInfo.IsLinux)
|
||||
{
|
||||
ServicePointManager.ServerCertificateValidationCallback = ValidationCallback;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool ValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslpolicyerrors)
|
||||
{
|
||||
Logger.Warn("[{0}] {1}", sender.GetType(), sslpolicyerrors);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue