From f900553b58b3c54dcd9a89061439bb8c162e1d6c Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 27 Aug 2008 20:27:18 +0000 Subject: [PATCH] * Updates OGP module to define a default starting point * An attempt to solve an intermittan SSL Certificate validation error causing communications havok. --- .../InterGrid/OpenGridProtocolModule.cs | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs index ce3c62f383..c0ef208317 100644 --- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs @@ -121,8 +121,17 @@ namespace OpenSim.Region.Environment.Modules.InterGrid } catch (NotImplementedException) { - m_log.Error("[OGP]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions."); + try + { + // Mono does not implement the ServicePointManager.ServerCertificateValidationCallback yet! Don't remove this! + ServicePointManager.CertificatePolicy = new MonoCert(); + } + catch (Exception) + { + m_log.Error("[OGP]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions."); + } } + } if (!m_scene.Contains(scene)) @@ -268,7 +277,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid agentData.lastname = LastName; agentData.SecureSessionID=LLUUID.Random(); agentData.SessionID=LLUUID.Random(); - agentData.startpos=LLVector3.Zero; + agentData.startpos = new LLVector3(128f, 128f, 100f); // Pre-Fill our region cache with information on the agent. UserAgentData useragent = new UserAgentData(); @@ -556,6 +565,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid string rrAccess = rezResponseMap["sim_access"].AsString(); LLSDArray RezResponsePositionArray = (LLSDArray)rezResponseMap["position"]; + responseMap["seed_capability"] = LLSD.FromString(rezRespSeedCap); responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString()); @@ -876,4 +886,17 @@ namespace OpenSim.Region.Environment.Modules.InterGrid } } + public class MonoCert : ICertificatePolicy + { + + + #region ICertificatePolicy Members + + public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem) + { + return true; + } + + #endregion + } }