aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server
diff options
context:
space:
mode:
authorMelanie Thielker2014-04-26 02:42:30 +0200
committerMelanie Thielker2014-04-26 02:42:30 +0200
commit5c661baf6c197caef73e6a8fe5a2223d00a2a6ba (patch)
treee656d7a2bf8c4c24272f1bfe5d577d4bfc17090a /OpenSim/Server
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
Diffstat (limited to 'OpenSim/Server')
-rw-r--r--OpenSim/Server/Base/HttpServerBase.cs32
1 files changed, 21 insertions, 11 deletions
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