From dbbbec48dfbc51f30953d8a46f4fc8f192bd277c Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 14 Sep 2008 18:39:17 +0000 Subject: * This update makes configuring SSL a little easier on Windows XP. It also makes it possible to run a HTTPS server on the region. It also has a junk Certification authority for test purposes. * There are still a lot of things that are hard coded to use http. They need to be fixed. * Also includes directions * A standard junk PEM file to append to app_settings/CA.pem in the client so SSL will work --- .../Modules/InterGrid/OpenGridProtocolModule.cs | 57 ++++++++++++++++++++-- 1 file changed, 53 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/InterGrid') diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs index 6e37b95..68f35e8 100644 --- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs @@ -86,6 +86,9 @@ namespace OpenSim.Region.Environment.Modules.InterGrid private Dictionary m_OGPState = new Dictionary(); private string LastNameSuffix = "_EXTERNAL"; private string FirstNamePrefix = ""; + private string httpsCN = ""; + private bool httpSSL = false; + private uint httpsslport = 0; #region IRegionModule Members @@ -93,6 +96,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid { bool enabled = false; IConfig cfg = null; + IConfig httpcfg = null; try { cfg = config.Configs["OpenGridProtocol"]; @@ -100,6 +104,16 @@ namespace OpenSim.Region.Environment.Modules.InterGrid { enabled = false; } + + try + { + httpcfg = config.Configs["Network"]; + } + catch (NullReferenceException) + { + + } + if (cfg != null) { enabled = cfg.GetBoolean("ogp_enabled", false); @@ -139,6 +153,20 @@ namespace OpenSim.Region.Environment.Modules.InterGrid } } } + lock (m_scene) + { + if (m_scene.Count == 1) + { + if (httpcfg != null) + { + httpSSL = httpcfg.GetBoolean("http_listener_ssl", false); + httpsCN = httpcfg.GetString("http_listener_cn", scene.RegionInfo.ExternalHostName); + if (httpsCN.Length == 0) + httpsCN = scene.RegionInfo.ExternalHostName; + httpsslport = (uint)httpcfg.GetInt("http_listener_sslport",((int)scene.RegionInfo.HttpPort + 1)); + } + } + } // Of interest to this module potentially //scene.EventManager.OnNewClient += OnNewClient; //scene.EventManager.OnGridInstantMessageToFriendsModule += OnGridInstantMessage; @@ -371,14 +399,35 @@ namespace OpenSim.Region.Environment.Modules.InterGrid // Get a reference to the user's cap so we can pull out the Caps Object Path OpenSim.Framework.Communications.Capabilities.Caps userCap = homeScene.GetCapsHandlerForUser(agentData.AgentID); + string rezHttpProtocol = "http://"; + string regionCapsHttpProtocol = "http://"; + string httpaddr = reg.ExternalHostName; + string urlport = reg.HttpPort.ToString(); + + + if (httpSSL) + { + rezHttpProtocol = "https://"; + + urlport = httpsslport.ToString(); + + if (httpsCN.Length > 0) + httpaddr = httpsCN; + } + + + // Be warned that the two following lines assume http not + // https since region caps are not implemented in https currently + // DEPRECIATED - responseMap["seed_capability"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); + responseMap["seed_capability"] = LLSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); // REPLACEMENT - responseMap["region_seed_capability"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); + responseMap["region_seed_capability"] = LLSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); + - responseMap["rez_avatar/rez"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + rezAvatarPath); - responseMap["rez_avatar/derez"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + derezAvatarPath); + responseMap["rez_avatar/rez"] = LLSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); + responseMap["rez_avatar/derez"] = LLSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + derezAvatarPath); // Add the user to the list of CAPS that are outstanding. // well allow the caps hosts in this dictionary -- cgit v1.1