core: fix ignoresslerrors cli option (#9657)

This commit is contained in:
Diego Heras
2020-09-26 19:50:58 +02:00
committed by GitHub
parent bbe99c4123
commit 7279edf354
5 changed files with 24 additions and 52 deletions

View File

@@ -193,15 +193,7 @@ namespace Jackett.Common.Utils.Clients
protected virtual async Task<WebResult> Run(WebRequest webRequest) => throw new NotImplementedException();
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
public virtual void Init()
{
if (serverConfig.RuntimeSettings.IgnoreSslErrors == true)
{
logger.Info($"WebClient({ClientType}): Disabling certificate validation");
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => { return true; };
}
}
public virtual void Init() => ServicePointManager.DefaultConnectionLimit = 1000;
public virtual void OnCompleted() => throw new NotImplementedException();