Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2009-07-02 11:39:40 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2009-07-02 11:39:40 +0400
commitf760e84e5821175666af514953bce2fb16524220 (patch)
tree34faada82fd5a596b9cd0fa5e8e607bd728cb734 /mcs/class/System
parent77e7d3d183ccbde9405192327efb6173029c453e (diff)
2009-07-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
* ServicePointManager.cs: implement ServerCertificateValidationCallback. * DefaultCertificatePolicy.cs: if there's a SCVC registered, don't do normal error checking.a svn path=/trunk/mcs/; revision=137253
Diffstat (limited to 'mcs/class/System')
-rw-r--r--mcs/class/System/System.Net/ChangeLog6
-rw-r--r--mcs/class/System/System.Net/DefaultCertificatePolicy.cs6
-rw-r--r--mcs/class/System/System.Net/ServicePointManager.cs10
3 files changed, 18 insertions, 4 deletions
diff --git a/mcs/class/System/System.Net/ChangeLog b/mcs/class/System/System.Net/ChangeLog
index 3629fb0b92e..37e2909b95b 100644
--- a/mcs/class/System/System.Net/ChangeLog
+++ b/mcs/class/System/System.Net/ChangeLog
@@ -1,5 +1,11 @@
2009-07-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
+ * ServicePointManager.cs: implement ServerCertificateValidationCallback.
+ * DefaultCertificatePolicy.cs: if there's a SCVC registered, don't do
+ normal error checking.a
+
+2009-07-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
* HttpWebRequest.cs: avoid duplicating Accept-Encoding if GetHeaders()
is called twice.
* WebConnectionStream.cs: don't send a 0 content length for non-write
diff --git a/mcs/class/System/System.Net/DefaultCertificatePolicy.cs b/mcs/class/System/System.Net/DefaultCertificatePolicy.cs
index 12d3602d888..82d3369389b 100644
--- a/mcs/class/System/System.Net/DefaultCertificatePolicy.cs
+++ b/mcs/class/System/System.Net/DefaultCertificatePolicy.cs
@@ -39,6 +39,11 @@ namespace System.Net {
// but) expired certificates.
public bool CheckValidationResult (ServicePoint point, X509Certificate certificate, WebRequest request, int certificateProblem)
{
+#if NET_2_0 && 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 {
}
}
}
+
diff --git a/mcs/class/System/System.Net/ServicePointManager.cs b/mcs/class/System/System.Net/ServicePointManager.cs
index bea42e48cc3..22926e35fc9 100644
--- a/mcs/class/System/System.Net/ServicePointManager.cs
+++ b/mcs/class/System/System.Net/ServicePointManager.cs
@@ -109,6 +109,9 @@ namespace System.Net
#endif
static bool useNagle;
#endif
+#if NET_2_0
+ static RemoteCertificateValidationCallback server_cert_cb;
+#endif
// Fields
@@ -240,15 +243,14 @@ namespace System.Net
set { _securityProtocol = value; }
}
-#if NET_2_0 && SECURITY_DEP
- [MonoTODO]
+#if NET_2_0
public static RemoteCertificateValidationCallback ServerCertificateValidationCallback
{
get {
- throw GetMustImplement ();
+ return server_cert_cb;
}
set {
- throw GetMustImplement ();
+ server_cert_cb = value;
}
}
#endif