From 7d5f03220384092ed2cb8a86d489e0151774f496 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Tue, 4 Dec 2007 05:47:51 +0000 Subject: * Added SSL Support to HttpListener * Added SSL Option to User Server to allow logins to be done via SSL. * Added sane handling for when Remote Admin Plugin configuration is not found * Added some performance boosts to an area of libTerrain which was highlighted in profiling. --- OpenSim/Framework/Servers/BaseHttpServer.cs | 16 +++++++++++++++- OpenSim/Framework/UserConfig.cs | 7 +++++++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index aa6d315..81829c4 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -45,6 +45,7 @@ namespace OpenSim.Framework.Servers protected Dictionary m_rpcHandlers = new Dictionary(); protected Dictionary m_streamHandlers = new Dictionary(); protected int m_port; + protected bool m_ssl = false; protected bool m_firstcaps = true; public int Port @@ -57,6 +58,12 @@ namespace OpenSim.Framework.Servers m_port = port; } + public BaseHttpServer(int port, bool ssl) + { + m_ssl = ssl; + BaseHttpServer(port); + } + public void AddStreamHandler(IRequestHandler handler) { string httpMethod = handler.HttpMethod; @@ -252,7 +259,14 @@ namespace OpenSim.Framework.Servers MainLog.Instance.Verbose("HTTPD", "Spawned main thread OK"); m_httpListener = new HttpListener(); - m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); + if (!m_ssl) + { + m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); + } + else + { + m_httpListener.Prefixes.Add("https://+:" + m_port + "/"); + } m_httpListener.Start(); HttpListenerContext context; diff --git a/OpenSim/Framework/UserConfig.cs b/OpenSim/Framework/UserConfig.cs index 4c6b3b8..1cc00c7 100644 --- a/OpenSim/Framework/UserConfig.cs +++ b/OpenSim/Framework/UserConfig.cs @@ -43,7 +43,9 @@ namespace OpenSim.Framework public string DatabaseProvider = ""; public static uint DefaultHttpPort = 8002; + public static bool DefaultHttpSSL = false; public uint HttpPort = DefaultHttpPort; + public bool HttpSSL = DefaultHttpSSL; public uint DefaultX = 1000; public uint DefaultY = 1000; @@ -80,6 +82,8 @@ namespace OpenSim.Framework configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Http Listener port", DefaultHttpPort.ToString(), false); + configMember.addConfigurationOption("http_ssl", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, + "Use SSL? true/false", DefaultHttpSSL.ToString(), false); configMember.addConfigurationOption("default_X", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Known good region X", "1000", false); configMember.addConfigurationOption("default_Y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, @@ -111,6 +115,9 @@ namespace OpenSim.Framework case "http_port": HttpPort = (uint) configuration_result; break; + case "http_ssl": + HttpSSL = (bool)configuration_result; + break; case "default_X": DefaultX = (uint)configuration_result; break; -- cgit v1.1