Merge pull request #2092 from kasthack/system-web-stuff-import
[mono.git] / mcs / class / System / System.Net / DefaultCertificatePolicy.cs
index 12d3602d88865221a93ef5b3813104a4663b2679..011c295a5eae34cceb518fb174fd1df816cfe591 100644 (file)
@@ -39,6 +39,11 @@ namespace System.Net {
                // but) expired certificates.
                public bool CheckValidationResult (ServicePoint point, X509Certificate certificate, WebRequest request, int certificateProblem)
                {
+#if SECURITY_DEP
+                       // If using default policy and the new callback is there, ignore this
+                       if (ServicePointManager.ServerCertificateValidationCallback != null)
+                               return true;
+#endif
                        switch (certificateProblem) {
                                case 0:                 // No error
                                case -2146762495:       // CERT_E_EXPIRED 0x800B0101 (WinError.h)
@@ -49,3 +54,4 @@ namespace System.Net {
                }
        }
 }
+