Testing if ServicePointManager.ServerCertificateValidationCallback works in the latest version of Mono

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3055 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2009-08-03 22:10:32 +00:00
parent 0c18efa8e2
commit 7b10da33fa

View File

@@ -26,6 +26,7 @@
using System;
using System.Net;
using System.Net.Security;
using System.IO;
using System.Text;
using System.Threading;
@@ -36,10 +37,16 @@ namespace OpenMetaverse.Http
public class TrustAllCertificatePolicy : ICertificatePolicy
{
public TrustAllCertificatePolicy() { }
public bool CheckValidationResult(ServicePoint sp, X509Certificate cert, WebRequest req, int problem)
{
return true;
}
public static bool TrustAllCertificateHandler(Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
}
}
public static class CapsBase
@@ -50,7 +57,8 @@ namespace OpenMetaverse.Http
static CapsBase()
{
System.Net.ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
//ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
ServicePointManager.ServerCertificateValidationCallback = TrustAllCertificatePolicy.TrustAllCertificateHandler;
}
private class RequestState