aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2014-04-26 02:42:30 +0200
committerMelanie Thielker2014-04-26 02:42:30 +0200
commit5c661baf6c197caef73e6a8fe5a2223d00a2a6ba (patch)
treee656d7a2bf8c4c24272f1bfe5d577d4bfc17090a
parentminor: Remove unused System.Linq reference and use ParcelFlags.None instead o... (diff)
downloadopensim-SC_OLD-5c661baf6c197caef73e6a8fe5a2223d00a2a6ba.zip
opensim-SC_OLD-5c661baf6c197caef73e6a8fe5a2223d00a2a6ba.tar.gz
opensim-SC_OLD-5c661baf6c197caef73e6a8fe5a2223d00a2a6ba.tar.bz2
opensim-SC_OLD-5c661baf6c197caef73e6a8fe5a2223d00a2a6ba.tar.xz
Allow opening a https port using only http so that nginx can be used for ssl
-rw-r--r--OpenSim/Framework/NetworkServersInfo.cs2
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs26
-rw-r--r--OpenSim/Server/Base/HttpServerBase.cs32
3 files changed, 42 insertions, 18 deletions
diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs
index 4b7d4c7..dfe9695 100644
--- a/OpenSim/Framework/NetworkServersInfo.cs
+++ b/OpenSim/Framework/NetworkServersInfo.cs
@@ -41,6 +41,7 @@ namespace OpenSim.Framework
41 41
42 // "Out of band" managemnt https 42 // "Out of band" managemnt https
43 public bool ssl_listener = false; 43 public bool ssl_listener = false;
44 public bool ssl_external = false;
44 public uint https_port = 0; 45 public uint https_port = 0;
45 public string cert_path = String.Empty; 46 public string cert_path = String.Empty;
46 public string cert_pass = String.Empty; 47 public string cert_pass = String.Empty;
@@ -64,6 +65,7 @@ namespace OpenSim.Framework
64 65
65 // "Out of band management https" 66 // "Out of band management https"
66 ssl_listener = config.Configs["Network"].GetBoolean("https_listener",false); 67 ssl_listener = config.Configs["Network"].GetBoolean("https_listener",false);
68 ssl_external = config.Configs["Network"].GetBoolean("https_external",false);
67 if( ssl_listener) 69 if( ssl_listener)
68 { 70 {
69 cert_path = config.Configs["Network"].GetString("cert_path",String.Empty); 71 cert_path = config.Configs["Network"].GetString("cert_path",String.Empty);
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index 853b72d..287c278 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -100,13 +100,25 @@ namespace OpenSim.Region.ClientStack
100 // "OOB" Server 100 // "OOB" Server
101 if (m_networkServersInfo.ssl_listener) 101 if (m_networkServersInfo.ssl_listener)
102 { 102 {
103 BaseHttpServer server = new BaseHttpServer( 103 if (!m_networkServersInfo.ssl_external)
104 m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path, 104 {
105 m_networkServersInfo.cert_pass); 105 BaseHttpServer server = new BaseHttpServer(
106 m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path,
107 m_networkServersInfo.cert_pass);
106 108
107 m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); 109 m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port);
108 MainServer.AddHttpServer(server); 110 MainServer.AddHttpServer(server);
109 server.Start(); 111 server.Start();
112 }
113 else
114 {
115 BaseHttpServer server = new BaseHttpServer(
116 m_networkServersInfo.https_port);
117
118 m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port);
119 MainServer.AddHttpServer(server);
120 server.Start();
121 }
110 } 122 }
111 123
112 base.StartupSpecific(); 124 base.StartupSpecific();
@@ -132,4 +144,4 @@ namespace OpenSim.Region.ClientStack
132 return physicsPluginManager.GetPhysicsScene(engine, meshEngine, config, osSceneIdentifier); 144 return physicsPluginManager.GetPhysicsScene(engine, meshEngine, config, osSceneIdentifier);
133 } 145 }
134 } 146 }
135} \ No newline at end of file 147}
diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs
index 954783c..eed2645 100644
--- a/OpenSim/Server/Base/HttpServerBase.cs
+++ b/OpenSim/Server/Base/HttpServerBase.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Server.Base
40{ 40{
41 public class HttpServerBase : ServicesServerBase 41 public class HttpServerBase : ServicesServerBase
42 { 42 {
43// private static readonly ILog m_Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 private uint m_consolePort; 45 private uint m_consolePort;
46 46
@@ -69,6 +69,7 @@ namespace OpenSim.Server.Base
69 69
70 bool ssl_main = networkConfig.GetBoolean("https_main",false); 70 bool ssl_main = networkConfig.GetBoolean("https_main",false);
71 bool ssl_listener = networkConfig.GetBoolean("https_listener",false); 71 bool ssl_listener = networkConfig.GetBoolean("https_listener",false);
72 bool ssl_external = networkConfig.GetBoolean("https_external",false);
72 73
73 m_consolePort = (uint)networkConfig.GetInt("ConsolePort", 0); 74 m_consolePort = (uint)networkConfig.GetInt("ConsolePort", 0);
74 75
@@ -113,20 +114,29 @@ namespace OpenSim.Server.Base
113 114
114 uint https_port = (uint)networkConfig.GetInt("https_port", 0); 115 uint https_port = (uint)networkConfig.GetInt("https_port", 0);
115 116
116 string cert_path = networkConfig.GetString("cert_path",String.Empty); 117 m_log.WarnFormat("[SSL]: External flag is {0}", ssl_external);
117 if ( cert_path == String.Empty ) 118 if (!ssl_external)
118 { 119 {
119 System.Console.WriteLine("Path to X509 certificate is missing, server can't start."); 120 string cert_path = networkConfig.GetString("cert_path",String.Empty);
120 Thread.CurrentThread.Abort(); 121 if ( cert_path == String.Empty )
122 {
123 System.Console.WriteLine("Path to X509 certificate is missing, server can't start.");
124 Thread.CurrentThread.Abort();
125 }
126 string cert_pass = networkConfig.GetString("cert_pass",String.Empty);
127 if ( cert_pass == String.Empty )
128 {
129 System.Console.WriteLine("Password for X509 certificate is missing, server can't start.");
130 Thread.CurrentThread.Abort();
131 }
132
133 MainServer.AddHttpServer(new BaseHttpServer(https_port, ssl_listener, cert_path, cert_pass));
121 } 134 }
122 string cert_pass = networkConfig.GetString("cert_pass",String.Empty); 135 else
123 if ( cert_pass == String.Empty )
124 { 136 {
125 System.Console.WriteLine("Password for X509 certificate is missing, server can't start."); 137 m_log.WarnFormat("[SSL]: SSL port is active but no SSL is used because external SSL was requested.");
126 Thread.CurrentThread.Abort(); 138 MainServer.AddHttpServer(new BaseHttpServer(https_port));
127 } 139 }
128
129 MainServer.AddHttpServer(new BaseHttpServer(https_port, ssl_listener, cert_path, cert_pass));
130 } 140 }
131 } 141 }
132 142