New: SSL certificates will not be checked for validity (to support self-signed certificates)
This commit is contained in:
parent
36a5eea951
commit
c2a09b70f4
|
@ -1,27 +1,18 @@
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Security;
|
using System.Net.Security;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using NLog;
|
|
||||||
using NzbDrone.Common.EnvironmentInfo;
|
|
||||||
using NzbDrone.Common.Instrumentation;
|
|
||||||
|
|
||||||
namespace NzbDrone.Common.Security
|
namespace NzbDrone.Common.Security
|
||||||
{
|
{
|
||||||
public static class IgnoreCertErrorPolicy
|
public static class IgnoreCertErrorPolicy
|
||||||
{
|
{
|
||||||
private static readonly Logger Logger = NzbDroneLogger.GetLogger();
|
|
||||||
|
|
||||||
public static void Register()
|
public static void Register()
|
||||||
{
|
|
||||||
if (OsInfo.IsLinux)
|
|
||||||
{
|
{
|
||||||
ServicePointManager.ServerCertificateValidationCallback = ValidationCallback;
|
ServicePointManager.ServerCertificateValidationCallback = ValidationCallback;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private static bool ValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslpolicyerrors)
|
private static bool ValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslpolicyerrors)
|
||||||
{
|
{
|
||||||
Logger.Warn("[{0}] {1}", sender.GetType(), sslpolicyerrors);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue