X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FSystem.Net%2FDefaultCertificatePolicy.cs;h=011c295a5eae34cceb518fb174fd1df816cfe591;hb=e2b2d181084848f3c5dde2788370db1b79893c69;hp=88c6c8b58029f2927de15b7c5cdc9a88773ba3c4;hpb=1c14f1ee6d701510c15499d71fc2b324151a8629;p=mono.git diff --git a/mcs/class/System/System.Net/DefaultCertificatePolicy.cs b/mcs/class/System/System.Net/DefaultCertificatePolicy.cs index 88c6c8b5802..011c295a5ea 100644 --- a/mcs/class/System/System.Net/DefaultCertificatePolicy.cs +++ b/mcs/class/System/System.Net/DefaultCertificatePolicy.cs @@ -1,11 +1,11 @@ -// -// System.Net.DefaultCertificatePolicy: Default policy applicable to -// -// Authors: +// +// System.Net.DefaultCertificatePolicy: Default policy applicable to +// +// Authors: // Sebastien Pouliot // -// Copyright (C) 2004 Novell (http://www.novell.com) -// +// Copyright (C) 2004 Novell (http://www.novell.com) +// // // Permission is hereby granted, free of charge, to any person obtaining @@ -31,21 +31,27 @@ using System.Security.Cryptography.X509Certificates; namespace System.Net { - + internal class DefaultCertificatePolicy : ICertificatePolicy { // This is the same default policy as used by the .NET // framework. It accepts valid certificates and (valid - // but) expired certificates. - public bool CheckValidationResult (ServicePoint point, X509Certificate certificate, WebRequest request, int certificateProblem) + // 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) return true; default: return false; - } - } - } + } + } + } } +