From c28cafba0a1b92f065541ebdae9db06ab1e5ac82 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Thu, 14 Jan 2021 22:04:54 +0100 Subject: [PATCH] Fixed: Unnecessary certificate validation errors on localhost/loopback closes #4215 --- .../Security/X509CertificateValidationService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Security/X509CertificateValidationService.cs b/src/NzbDrone.Core/Security/X509CertificateValidationService.cs index 3310e3c7a..b4578bc0e 100644 --- a/src/NzbDrone.Core/Security/X509CertificateValidationService.cs +++ b/src/NzbDrone.Core/Security/X509CertificateValidationService.cs @@ -41,6 +41,11 @@ namespace NzbDrone.Core.Security return true; } + if (request.RequestUri.Host == "localhost" || request.RequestUri.Host == "127.0.0.1") + { + return true; + } + var ipAddresses = GetIPAddresses(request.RequestUri.Host); var certificateValidation = _configService.CertificateValidation; @@ -55,7 +60,6 @@ namespace NzbDrone.Core.Security return true; } - _logger.Error("Certificate validation for {0} failed. {1}", request.Address, sslPolicyErrors); return false;