From 18a2db5af2c9d47f54cd8e3660e3191b839caa25 Mon Sep 17 00:00:00 2001 From: flightlevel Date: Wed, 2 Dec 2015 21:19:51 +1100 Subject: [PATCH 1/3] Linux: Ignore SSL certificate errors option added Linux: Ignore SSL certificate errors option added --- README.md | 2 +- src/Jackett.Console/ConsoleOptions.cs | 3 +++ src/Jackett.Console/Program.cs | 8 ++++++++ src/Jackett/CurlHelper.cs | 6 ++++++ src/Jackett/Startup.cs | 6 ++++++ 5 files changed, 24 insertions(+), 1 deletion(-) 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. From c3642ffcbb87b0945e1fb3baa6b5af5772bdbafd Mon Sep 17 00:00:00 2001 From: flightlevel Date: Wed, 2 Dec 2015 21:48:17 +1100 Subject: [PATCH 2/3] SpeedCD- Change login URL SpeedCD- Change login URL --- src/Jackett/Indexers/SpeedCD.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Jackett/Indexers/SpeedCD.cs b/src/Jackett/Indexers/SpeedCD.cs index 8c7d456f1..cd25295f0 100644 --- a/src/Jackett/Indexers/SpeedCD.cs +++ b/src/Jackett/Indexers/SpeedCD.cs @@ -21,7 +21,7 @@ namespace Jackett.Indexers { public class SpeedCD : BaseIndexer, IIndexer { - private string LoginUrl { get { return SiteLink + "take_login.php"; } } + private string LoginUrl { get { return SiteLink + "login.php"; } } private string SearchUrl { get { return SiteLink + "V3/API/API.php"; } } private string SearchFormData { get { return "c53=1&c49=1&c2=1&c52=1&c41=1&c50=1&c30=1&jxt=4&jxw=b"; } } private string CommentsUrl { get { return SiteLink + "t/{0}"; } } From a2872fdf77b531fd8cdf8ab58ba1c5a53fe1f874 Mon Sep 17 00:00:00 2001 From: Bram Roets Date: Fri, 4 Dec 2015 10:55:54 +0100 Subject: [PATCH 3/3] Speed.cd - login url fix --- src/Jackett/Indexers/SpeedCD.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Jackett/Indexers/SpeedCD.cs b/src/Jackett/Indexers/SpeedCD.cs index cd25295f0..8cf25dfd2 100644 --- a/src/Jackett/Indexers/SpeedCD.cs +++ b/src/Jackett/Indexers/SpeedCD.cs @@ -21,7 +21,7 @@ namespace Jackett.Indexers { public class SpeedCD : BaseIndexer, IIndexer { - private string LoginUrl { get { return SiteLink + "login.php"; } } + private string LoginUrl { get { return SiteLink + "take.login.php"; } } private string SearchUrl { get { return SiteLink + "V3/API/API.php"; } } private string SearchFormData { get { return "c53=1&c49=1&c2=1&c52=1&c41=1&c50=1&c30=1&jxt=4&jxw=b"; } } private string CommentsUrl { get { return SiteLink + "t/{0}"; } }