aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs26
-rw-r--r--OpenSim/Region/Application/RegionApplicationBase.cs51
2 files changed, 59 insertions, 18 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 52ded3d..90505e1 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
diff --git a/OpenSim/Region/Application/RegionApplicationBase.cs b/OpenSim/Region/Application/RegionApplicationBase.cs
index ba92fd6..77b0138 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,38 @@ 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
74 m_networkServersInfo.HttpSSLCN); 75 if (m_networkServersInfo.HttpUsesSSL && (mainport == mainSSLport))
75
76 if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort))
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 mainSSLport, m_networkServersInfo.HttpSSLCN,
85 m_networkServersInfo.HttpSSLCertPath, m_networkServersInfo.HttpSSLCNCertPass);
86 m_httpServer.Start(true,true);
87 MainServer.AddHttpServer(m_httpServer);
88
89 }
90
91 // unsecure main server
92 BaseHttpServer server = new BaseHttpServer(mainport);
93 if(!m_networkServersInfo.HttpUsesSSL)
94 {
95 m_httpServer = server;
96 server.Start(true, true);
97 }
98 else
99 server.Start(false, false);
100
101 MainServer.AddHttpServer(server);
102 MainServer.ÚnSecureInstance = server;
83 103
84 MainServer.AddHttpServer(m_httpServer);
85 MainServer.Instance = m_httpServer; 104 MainServer.Instance = m_httpServer;
86 105
87 // "OOB" Server 106 // "OOB" Server
@@ -89,22 +108,22 @@ namespace OpenSim
89 { 108 {
90 if (!m_networkServersInfo.ssl_external) 109 if (!m_networkServersInfo.ssl_external)
91 { 110 {
92 BaseHttpServer server = new BaseHttpServer( 111 server = new BaseHttpServer(
93 m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path, 112 m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener,
113 m_networkServersInfo.cert_path,
94 m_networkServersInfo.cert_pass); 114 m_networkServersInfo.cert_pass);
95 115
96 m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); 116 m_log.InfoFormat("[REGION SERVER]: Starting OOB HTTPS server on port {0}", server.SSLPort);
117 server.Start(false, false);
97 MainServer.AddHttpServer(server); 118 MainServer.AddHttpServer(server);
98 server.Start();
99 } 119 }
100 else 120 else
101 { 121 {
102 BaseHttpServer server = new BaseHttpServer( 122 server = new BaseHttpServer(m_networkServersInfo.https_port);
103 m_networkServersInfo.https_port);
104 123
105 m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port); 124 m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port);
125 server.Start(false, false);
106 MainServer.AddHttpServer(server); 126 MainServer.AddHttpServer(server);
107 server.Start();
108 } 127 }
109 } 128 }
110 129