mirror of
https://github.com/Jackett/Jackett
synced 2025-02-24 23:22:46 +00:00
Add Windows support for the IgnoreSslErrors option (#594)
This commit is contained in:
parent
6b253178b6
commit
e7918bddbc
3 changed files with 8 additions and 2 deletions
|
@ -57,7 +57,7 @@ namespace Jackett.Console
|
|||
[Option('f', "SSLFix", HelpText = "[true/false] Linux Libcurl NSS Missing ECC Ciphers workaround (Use if you can't access some trackers) .")]
|
||||
public bool? SSLFix { get; set; }
|
||||
|
||||
[Option('n', "IgnoreSslErrors", HelpText = "[true/false] Linux Libcurl - Ignores invalid SSL certificates")]
|
||||
[Option('n', "IgnoreSslErrors", HelpText = "[true/false] Ignores invalid SSL certificates")]
|
||||
public bool? IgnoreSslErrors { get; set; }
|
||||
|
||||
[Option('d', "DataFolder", HelpText = "Specify the location of the data folder (Must be admin on Windows) eg. --DataFolder=\"D:\\Your Data\\Jackett\\\"")]
|
||||
|
|
|
@ -9,6 +9,7 @@ using System.Collections.Generic;
|
|||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
@ -96,7 +97,7 @@ namespace JackettConsole
|
|||
Startup.IgnoreSslErrors = options.IgnoreSslErrors;
|
||||
if (options.IgnoreSslErrors == true)
|
||||
{
|
||||
Engine.Logger.Info("Curl will ignore SSL certificate errors.");
|
||||
Engine.Logger.Info("Jackett will ignore SSL certificate errors.");
|
||||
}
|
||||
|
||||
// Choose Data Folder
|
||||
|
|
|
@ -27,6 +27,11 @@ namespace Jackett.Utils.Clients
|
|||
|
||||
public void Init()
|
||||
{
|
||||
if (Startup.IgnoreSslErrors == true)
|
||||
{
|
||||
logger.Info(string.Format("WindowsWebClient: Disabling certificate validation"));
|
||||
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => { return true; };
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<WebClientByteResult> GetBytes(WebRequest request)
|
||||
|
|
Loading…
Reference in a new issue