diff --git a/README.md b/README.md index fa337327b..500438094 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ You can pass various options when running via the command line, see --help for d * Unable to connect to certain trackers on Linux -Try running with the "--SSLFix true" if you are on Redhat/Fedora/NNS based libcurl. If the tracker is currently configured try removing it and adding it again. Alternatively try running with a different client via --UseClient (Warning: safecurl just executes curl and your details may be seen from the process list). +Try running with the "--SSLFix true" if you are on Redhat/Fedora/NNS based libcurl. If the tracker is currently configured try removing it and adding it again. Alternatively try running with a different client via --UseClient (Warning: safecurl just executes curl and your details may be seen from the process list). You can also try running with the "--IgnoreSslErrors true" option which is useful if the site has an invalid SSL certificate. * Enable logging diff --git a/src/Jackett.Console/ConsoleOptions.cs b/src/Jackett.Console/ConsoleOptions.cs index 8ad9bd000..635eb2e2a 100644 --- a/src/Jackett.Console/ConsoleOptions.cs +++ b/src/Jackett.Console/ConsoleOptions.cs @@ -54,6 +54,9 @@ 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")] + public bool? IgnoreSslErrors { get; set; } + [ParserState] public IParserState LastParserState { get; set; } } diff --git a/src/Jackett.Console/Program.cs b/src/Jackett.Console/Program.cs index f83d4ed14..a5b5ad941 100644 --- a/src/Jackett.Console/Program.cs +++ b/src/Jackett.Console/Program.cs @@ -85,6 +85,14 @@ namespace JackettConsole Engine.Logger.Info("SSL ECC workaround enabled."); else if (options.SSLFix == false) Engine.Logger.Info("SSL ECC workaround has been disabled."); + + // Ignore SSL errors on Curl + Startup.IgnoreSslErrors = options.IgnoreSslErrors; + if (options.IgnoreSslErrors == true) + { + Engine.Logger.Info("Curl will ignore SSL certificate errors."); + } + /* ====== Actions ===== */ // Install service diff --git a/src/Jackett/CurlHelper.cs b/src/Jackett/CurlHelper.cs index 08d01a3bc..c2a94cdd9 100644 --- a/src/Jackett/CurlHelper.cs +++ b/src/Jackett/CurlHelper.cs @@ -135,6 +135,12 @@ namespace Jackett easy.ForbidReuse = true; } + if (Startup.IgnoreSslErrors == true) + { + easy.SetOpt(CurlOption.SslVerifyhost, false); + easy.SetOpt(CurlOption.SslVerifyPeer, false); + } + easy.Perform(); if (easy.LastErrorCode != CurlCode.Ok) diff --git a/src/Jackett/Startup.cs b/src/Jackett/Startup.cs index 8e4070d26..7426088f0 100644 --- a/src/Jackett/Startup.cs +++ b/src/Jackett/Startup.cs @@ -46,6 +46,12 @@ namespace Jackett set; } + public static bool? IgnoreSslErrors + { + get; + set; + } + public void Configuration(IAppBuilder appBuilder) { // Configure Web API for self-host.