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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user