aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs32
-rw-r--r--OpenSim/Region/Application/RegionApplicationBase.cs48
2 files changed, 60 insertions, 20 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index b33e2c2..75dc741 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -351,7 +351,18 @@ namespace OpenSim
351 if (startupConfig == null || startupConfig.GetBoolean("JobEngineEnabled", true)) 351 if (startupConfig == null || startupConfig.GetBoolean("JobEngineEnabled", true))
352 WorkManager.JobEngine.Start(); 352 WorkManager.JobEngine.Start();
353 353
354 m_httpServerPort = m_networkServersInfo.HttpListenerPort; 354
355 if(m_networkServersInfo.HttpUsesSSL)
356 {
357 m_httpServerSSL = true;
358 m_httpServerPort = m_networkServersInfo.httpSSLPort;
359 }
360 else
361 {
362 m_httpServerSSL = false;
363 m_httpServerPort = m_networkServersInfo.HttpListenerPort;
364 }
365
355 SceneManager.OnRestartSim += HandleRestartRegion; 366 SceneManager.OnRestartSim += HandleRestartRegion;
356 367
357 // Only enable the watchdogs when all regions are ready. Otherwise we get false positives when cpu is 368 // Only enable the watchdogs when all regions are ready. Otherwise we get false positives when cpu is
@@ -404,7 +415,18 @@ namespace OpenSim
404 415
405 // set initial ServerURI 416 // set initial ServerURI
406 regionInfo.HttpPort = m_httpServerPort; 417 regionInfo.HttpPort = m_httpServerPort;
407 regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString() + "/"; 418 if(m_httpServerSSL)
419 {
420 if(!m_httpServer.CheckSSLCertHost(regionInfo.ExternalHostName))
421 throw new Exception("main http cert CN doesn't match region External IP");
422
423 regionInfo.ServerURI = "https://" + regionInfo.ExternalHostName +
424 ":" + regionInfo.HttpPort.ToString() + "/";
425 }
426 else
427 regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName +
428 ":" + regionInfo.HttpPort.ToString() + "/";
429
408 430
409 regionInfo.osSecret = m_osSecret; 431 regionInfo.osSecret = m_osSecret;
410 432
@@ -1103,10 +1125,10 @@ namespace OpenSim
1103 MainConsole.Instance.Output("Joining the estate failed. Please try again."); 1125 MainConsole.Instance.Output("Joining the estate failed. Please try again.");
1104 } 1126 }
1105 } 1127 }
1106 } 1128 }
1107 1129
1108 return true; // need to update the database 1130 return true; // need to update the database
1109 } 1131 }
1110 } 1132 }
1111 1133
1112 public class OpenSimConfigSource 1134 public class OpenSimConfigSource
diff --git a/OpenSim/Region/Application/RegionApplicationBase.cs b/OpenSim/Region/Application/RegionApplicationBase.cs
index 83a9fff..7e8308e 100644
--- a/OpenSim/Region/Application/RegionApplicationBase.cs
+++ b/OpenSim/Region/Application/RegionApplicationBase.cs
@@ -50,6 +50,7 @@ namespace OpenSim
50 protected Dictionary<EndPoint, uint> m_clientCircuits = new Dictionary<EndPoint, uint>(); 50 protected Dictionary<EndPoint, uint> m_clientCircuits = new Dictionary<EndPoint, uint>();
51 protected NetworkServersInfo m_networkServersInfo; 51 protected NetworkServersInfo m_networkServersInfo;
52 protected uint m_httpServerPort; 52 protected uint m_httpServerPort;
53 protected bool m_httpServerSSL;
53 protected ISimulationDataService m_simulationDataService; 54 protected ISimulationDataService m_simulationDataService;
54 protected IEstateDataService m_estateDataService; 55 protected IEstateDataService m_estateDataService;
55 56
@@ -68,20 +69,37 @@ namespace OpenSim
68 69
69 Initialize(); 70 Initialize();
70 71
71 m_httpServer 72 uint mainport = m_networkServersInfo.HttpListenerPort;
72 = new BaseHttpServer( 73 uint mainSSLport = m_networkServersInfo.httpSSLPort;
73 m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort,
74 m_networkServersInfo.HttpSSLCN);
75 74
76 if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort)) 75 if (m_networkServersInfo.HttpUsesSSL && (mainport == mainSSLport))
77 { 76 {
78 m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); 77 m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
79 } 78 }
80 79
81 m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort); 80 if(m_networkServersInfo.HttpUsesSSL)
82 m_httpServer.Start(); 81 {
82 m_httpServer = new BaseHttpServer(
83 mainSSLport, m_networkServersInfo.HttpUsesSSL,
84 m_networkServersInfo.HttpSSLCN,
85 m_networkServersInfo.HttpSSLCertPath, m_networkServersInfo.HttpSSLCNCertPass);
86 m_httpServer.Start(true,true);
87 MainServer.AddHttpServer(m_httpServer);
88 }
89
90 // unsecure main server
91 BaseHttpServer server = new BaseHttpServer(mainport);
92 if(!m_networkServersInfo.HttpUsesSSL)
93 {
94 m_httpServer = server;
95 server.Start(true, true);
96 }
97 else
98 server.Start(false, false);
99
100 MainServer.AddHttpServer(server);
101 MainServer.ÚnSecureInstance = server;
83 102
84 MainServer.AddHttpServer(m_httpServer);
85 MainServer.Instance = m_httpServer; 103 MainServer.Instance = m_httpServer;
86 104
87 // "OOB" Server 105 // "OOB" Server
@@ -89,22 +107,22 @@ namespace OpenSim
89 { 107 {
90 if (!m_networkServersInfo.ssl_external) 108 if (!m_networkServersInfo.ssl_external)
91 { 109 {
92 BaseHttpServer server = new BaseHttpServer( 110 server = new BaseHttpServer(
93 m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path, 111 m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener,
112 m_networkServersInfo.cert_path,
94 m_networkServersInfo.cert_pass); 113 m_networkServersInfo.cert_pass);
95 114
96 m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); 115 m_log.InfoFormat("[REGION SERVER]: Starting OOB HTTPS server on port {0}", server.SSLPort);
116 server.Start(false, false);
97 MainServer.AddHttpServer(server); 117 MainServer.AddHttpServer(server);
98 server.Start();
99 } 118 }
100 else 119 else
101 { 120 {
102 BaseHttpServer server = new BaseHttpServer( 121 server = new BaseHttpServer(m_networkServersInfo.https_port);
103 m_networkServersInfo.https_port);
104 122
105 m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port); 123 m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port);
124 server.Start(false, false);
106 MainServer.AddHttpServer(server); 125 MainServer.AddHttpServer(server);
107 server.Start();
108 } 126 }
109 } 127 }
110 128