From eceedba23b45e338089070e8b059da63082815a1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 17 Apr 2011 18:28:06 +0200 Subject: Fix the cert validation handler so that it will not block other parts of the server doing ssl successfully. --- .../CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 4c8424d..43672d1 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -118,7 +118,15 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest return true; } - return chain.Build(new X509Certificate2(certificate)); + if ((((int)sslPolicyErrors) & ~4) != 0) + return false; + + if (ServicePointManager.CertificatePolicy != null) + { + ServicePoint sp = Request.ServicePoint; + return ServicePointManager.CertificatePolicy.CheckValidationResult (sp, certificate, Request, 0); + } + return true; } #region IHttpRequestModule Members @@ -464,4 +472,4 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest } } } -} \ No newline at end of file +} -- cgit v1.1