mirror of https://github.com/Jackett/Jackett
Add Windows support for the IgnoreSslErrors option (#594)
This commit is contained in:
parent
6b253178b6
commit
e7918bddbc
|
@ -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) .")]
|
[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; }
|
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; }
|
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\\\"")]
|
[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.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
@ -96,7 +97,7 @@ namespace JackettConsole
|
||||||
Startup.IgnoreSslErrors = options.IgnoreSslErrors;
|
Startup.IgnoreSslErrors = options.IgnoreSslErrors;
|
||||||
if (options.IgnoreSslErrors == true)
|
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
|
// Choose Data Folder
|
||||||
|
|
|
@ -27,6 +27,11 @@ namespace Jackett.Utils.Clients
|
||||||
|
|
||||||
public void Init()
|
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)
|
public async Task<WebClientByteResult> GetBytes(WebRequest request)
|
||||||
|
|
Loading…
Reference in New Issue