[Opensim-dev] SSL Certificate Checking Disabling Causing Crash, here's the solution, WAS: [Opensim-users] OpenSim crash
Teravus Ovares
teravus at gmail.com
Sun May 29 17:44:01 UTC 2011
Hey all
Just noticed that we're trying to use
ServicePointManager.ServerCertificateValidationCallback in the
httpserver
Just a FYI, Not all versions of Mono will support this. I ran into
that with the OGP module. There's a workaround.
Create a class that Implements ICertificatePolicy and return true for
the CheckValidationResult method.
Example:
public class MonoCert : ICertificatePolicy
{
#region ICertificatePolicy Members
public bool CheckValidationResult(ServicePoint srvPoint,
X509Certificate certificate, WebRequest request, int
certificateProblem)
{
return true;
}
#endregion
}
Then, put a 'Not Implemented Exception' handler around the Callback
Assignment and call
ServicePointManager.CertificatePolicy = New MonoCert(); <---- Class
in example above.
This will generate depreciated warnings that you'll need to disable
about having code that mentions ServicePointManager.CertificatePolicy,
however, all new versions of Mono and .NET should use the newer
assignment.
-- Disable Warnings...
#pragma warning disable 0612, 0618
// Mono does not implement the
ServicePointManager.ServerCertificateValidationCallback yet! Don't
remove this!
ServicePointManager.CertificatePolicy = new MonoCert();
#pragma warning restore 0612, 0618
Full Code Example:
http://pastebin.ca/2071657
-Teravus
---------- Forwarded message ----------
From: Teravus Ovares <teravus at gmail.com>
Date: Sun, May 29, 2011 at 1:28 PM
Subject: Re: [Opensim-users] OpenSim crash
To: cliveg at gmail.com, opensim-users at lists.berlios.de
I'm not sure if this is implemented in Mono. It didn't use to be.
Maybe they implemented it recently. In either case, check your
version of Mono and make sure it supports
ServicePointManager.ServerCertificateValidationCallback
Regards
Teravus
Exception: System.Reflection.TargetInvocationException: Exception has
been thrown by the target of an invocation. --->
System.NotImplementedException: The requested feature is not
implemented.
at System.Net.ServicePointManager.get_ServerCertificateValidationCallback
() [0x00000]
at OpenSim.Region.CoreModules.Scripting.HttpRequest.HttpRequestModule..ctor
() [0x00000]
at (wrapper managed-to-native)
System.Reflection.MonoCMethod:InternalInvoke
(object,object[],System.Exception&)
On Sun, May 29, 2011 at 9:11 AM, Clive Gould <cliveg at gmail.com> wrote:
> Hi
>
> I've just upgraded MySQL on our server:
>
> [root at standbyvle ~]# rpm -q mysql
> mysql-5.5.12-1.el5.remi
>
> When I try to startt OpenSim I get the console message below.
>
> Is it the version of MySQL and if so is there any way to get OpenSim 0.7.1
> to work with mysql-5.5.12-1?
>
> Thanks very much
>
> Clive
>
> 14:04:51 - [MODULES]: Loading Region's modules (old style)
> 14:04:52 - [MODULES]: Could not load types for plugin DLL
> OpenSim.Region.CoreModules, Version=0.0.0.0, Culture=neutral,
> PublicKeyToken=null. Exception Exception has been thrown by the target of
> an invocation. at System.Reflection.MonoCMethod.Invoke (System.Object obj,
> BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[]
> parameters, System.Globalization.CultureInfo culture) [0x00000]
> at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr,
> System.Reflection.Binder binder, System.Object[] parameters,
> System.Globalization.CultureInfo culture) [0x00000]
> at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters)
> [0x00000]
> at System.Activator.CreateInstance (System.Type type, Boolean nonPublic)
> [0x00000]
> at System.Activator.CreateInstance (System.Type type) [0x00000]
> at OpenSim.Region.Framework.ModuleLoader.LoadModules (System.String
> dllName) [0x00000]
> 14:04:52 - [APPLICATION]:
> APPLICATION EXCEPTION DETECTED: System.UnhandledExceptionEventArgs
>
> Exception: System.Reflection.TargetInvocationException: Exception has been
> thrown by the target of an invocation. ---> System.NotImplementedException:
> The requested feature is not implemented.
> at System.Net.ServicePointManager.get_ServerCertificateValidationCallback
> () [0x00000]
> at
> OpenSim.Region.CoreModules.Scripting.HttpRequest.HttpRequestModule..ctor ()
> [0x00000]
> at (wrapper managed-to-native)
> System.Reflection.MonoCMethod:InternalInvoke
> (object,object[],System.Exception&)
> at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags
> invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
> System.Globalization.CultureInfo culture) [0x00000]
> --- End of inner exception stack trace ---
> at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags
> invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
> System.Globalization.CultureInfo culture) [0x00000]
> at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr,
> System.Reflection.Binder binder, System.Object[] parameters,
> System.Globalization.CultureInfo culture) [0x00000]
> at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters)
> [0x00000]
> at System.Activator.CreateInstance (System.Type type, Boolean nonPublic)
> [0x00000]
> at System.Activator.CreateInstance (System.Type type) [0x00000]
> at OpenSim.Region.Framework.ModuleLoader.LoadModules (System.String
> dllName) [0x00000]
> InnerException: System.NotImplementedException: The requested feature is not
> implemented.
> at System.Net.ServicePointManager.get_ServerCertificateValidationCallback
> () [0x00000]
> at
> OpenSim.Region.CoreModules.Scripting.HttpRequest.HttpRequestModule..ctor ()
> [0x00000]
> at (wrapper managed-to-native)
> System.Reflection.MonoCMethod:InternalInvoke
> (object,object[],System.Exception&)
> at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags
> invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
> System.Globalization.CultureInfo culture) [0x00000]
>
> Application is terminating: True
>
>
>
>
> _______________________________________________
> Opensim-users mailing list
> Opensim-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-users
>
>
More information about the Opensim-dev
mailing list