aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2016-10-06 21:35:11 +0100
committerUbitUmarov2016-10-06 21:35:11 +0100
commitb51739e23ecc071a107755c7613ff274f65c3a64 (patch)
treef86af87ea451271a06acc62e769e97ea33cd9bd9 /OpenSim/Region
parentMerge branch 'master' into httptests (diff)
downloadopensim-SC-b51739e23ecc071a107755c7613ff274f65c3a64.zip
opensim-SC-b51739e23ecc071a107755c7613ff274f65c3a64.tar.gz
opensim-SC-b51739e23ecc071a107755c7613ff274f65c3a64.tar.bz2
opensim-SC-b51739e23ecc071a107755c7613ff274f65c3a64.tar.xz
recover regions main http server ssl suport. Using a PKCS12 cert file, and not certs store for now. Option http_listener_cn, cert CN need to the same as external IP. Self sign certs do seem to work, but the viewers option NoVerifySLLCert needs to be set true. CA check is not done but they do check the IP
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs26
-rw-r--r--OpenSim/Region/Application/RegionApplicationBase.cs14
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs2
4 files changed, 35 insertions, 9 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 52ded3d..62abf8e 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_networkServersInfo.HttpSSLCN != 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..603f139 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
@@ -70,15 +71,18 @@ namespace OpenSim
70 71
71 m_httpServer 72 m_httpServer
72 = new BaseHttpServer( 73 = new BaseHttpServer(
73 m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort, 74 m_httpServerPort, m_networkServersInfo.HttpUsesSSL,
74 m_networkServersInfo.HttpSSLCN); 75 m_networkServersInfo.httpSSLPort, m_networkServersInfo.HttpSSLCN,
75 76 m_networkServersInfo.HttpSSLCertPath, m_networkServersInfo.HttpSSLCNCertPass);
77
78/* why this? we only run one
76 if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort)) 79 if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort))
77 { 80 {
78 m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); 81 m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
79 } 82 }
80 83*/
81 m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort); 84 m_log.InfoFormat("[REGION SERVER]: Starting HTTP{0} server on port {1}",
85 m_networkServersInfo.HttpUsesSSL ? "S" : "", m_httpServerPort);
82 m_httpServer.Start(); 86 m_httpServer.Start();
83 87
84 MainServer.AddHttpServer(m_httpServer); 88 MainServer.AddHttpServer(m_httpServer);
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
index 5eb4452..507d9b8 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests
65 // variables and the VM is not restarted between tests. 65 // variables and the VM is not restarted between tests.
66 MainServer.RemoveHttpServer(port); 66 MainServer.RemoveHttpServer(port);
67 67
68 BaseHttpServer server = new BaseHttpServer(port, false, sslPort, ""); 68 BaseHttpServer server = new BaseHttpServer(port, false, sslPort, "","","");
69 MainServer.AddHttpServer(server); 69 MainServer.AddHttpServer(server);
70 MainServer.Instance = server; 70 MainServer.Instance = server;
71 71
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
index 30dc4cd..1453204 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
87 uint port = 9999; 87 uint port = 9999;
88 MainServer.RemoveHttpServer(port); 88 MainServer.RemoveHttpServer(port);
89 89
90 BaseHttpServer server = new BaseHttpServer(port, false, 0, ""); 90 BaseHttpServer server = new BaseHttpServer(port, false, 0, "", "", "");
91 MainServer.AddHttpServer(server); 91 MainServer.AddHttpServer(server);
92 MainServer.Instance = server; 92 MainServer.Instance = server;
93 93