diff options
author | Teravus Ovares | 2008-08-26 05:20:46 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-08-26 05:20:46 +0000 |
commit | b3a6f8d688fa68d45cde43d81c1e7607e4f7cf57 (patch) | |
tree | e9b66194e28d505c5d5123382f9dc3b1b903b8f0 | |
parent | * Fixed a bug that occurred if your home region wasn't logged in, in standalo... (diff) | |
download | opensim-SC-b3a6f8d688fa68d45cde43d81c1e7607e4f7cf57.zip opensim-SC-b3a6f8d688fa68d45cde43d81c1e7607e4f7cf57.tar.gz opensim-SC-b3a6f8d688fa68d45cde43d81c1e7607e4f7cf57.tar.bz2 opensim-SC-b3a6f8d688fa68d45cde43d81c1e7607e4f7cf57.tar.xz |
* Workaround for application/llsd+xml requests coming in as application/xml
* When OGP is active, disable SSL certificate chain validation. I'll add more options here to come, as well as a way to test against a group of known certificate subjects.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/BaseHttpServer.cs | 48 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs | 20 |
2 files changed, 68 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 7b2b599..13c5752 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs | |||
@@ -272,6 +272,13 @@ namespace OpenSim.Framework.Servers | |||
272 | case "text/xml": | 272 | case "text/xml": |
273 | case "application/xml": | 273 | case "application/xml": |
274 | default: | 274 | default: |
275 | if (DoWeHaveALLSDHandler(request.RawUrl)) | ||
276 | { | ||
277 | m_log.ErrorFormat("[BASE HTTP SERVER]: Potentially incorrect content type on Registered LLSD CAP: Content Type:{0}", request.ContentType); | ||
278 | HandleLLSDRequests(request, response); | ||
279 | |||
280 | return; | ||
281 | } | ||
275 | HandleXmlRpcRequests(request, response); | 282 | HandleXmlRpcRequests(request, response); |
276 | return; | 283 | return; |
277 | } | 284 | } |
@@ -532,6 +539,47 @@ namespace OpenSim.Framework.Servers | |||
532 | } | 539 | } |
533 | } | 540 | } |
534 | 541 | ||
542 | private bool DoWeHaveALLSDHandler(string path) | ||
543 | { | ||
544 | |||
545 | string[] pathbase = path.Split('/'); | ||
546 | string searchquery = "/"; | ||
547 | |||
548 | if (pathbase.Length < 1) | ||
549 | return false; | ||
550 | |||
551 | for (int i = 1; i < pathbase.Length; i++) | ||
552 | { | ||
553 | searchquery += pathbase[i]; | ||
554 | if (pathbase.Length - 1 != i) | ||
555 | searchquery += "/"; | ||
556 | } | ||
557 | |||
558 | string bestMatch = null; | ||
559 | |||
560 | foreach (string pattern in m_llsdHandlers.Keys) | ||
561 | { | ||
562 | if (searchquery.StartsWith(searchquery)) | ||
563 | { | ||
564 | if (String.IsNullOrEmpty(bestMatch) || searchquery.Length > bestMatch.Length) | ||
565 | { | ||
566 | bestMatch = pattern; | ||
567 | } | ||
568 | } | ||
569 | } | ||
570 | |||
571 | if (String.IsNullOrEmpty(bestMatch)) | ||
572 | { | ||
573 | |||
574 | return false; | ||
575 | } | ||
576 | else | ||
577 | { | ||
578 | |||
579 | return true; | ||
580 | } | ||
581 | } | ||
582 | |||
535 | private bool TryGetLLSDHandler(string path, out LLSDMethod llsdHandler) | 583 | private bool TryGetLLSDHandler(string path, out LLSDMethod llsdHandler) |
536 | { | 584 | { |
537 | llsdHandler = null; | 585 | llsdHandler = null; |
diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs index e2a46a1..5874d9b 100644 --- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs | |||
@@ -30,6 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Net.Security; | 32 | using System.Net.Security; |
33 | using System.Security.Cryptography.X509Certificates; | ||
33 | using System.Net.Sockets; | 34 | using System.Net.Sockets; |
34 | using System.Reflection; | 35 | using System.Reflection; |
35 | using System.Text.RegularExpressions; | 36 | using System.Text.RegularExpressions; |
@@ -113,6 +114,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
113 | if (m_scene.Count == 0) | 114 | if (m_scene.Count == 0) |
114 | { | 115 | { |
115 | scene.AddLLSDHandler("/agent/", ProcessAgentDomainMessage); | 116 | scene.AddLLSDHandler("/agent/", ProcessAgentDomainMessage); |
117 | ServicePointManager.ServerCertificateValidationCallback += customXertificateValidation; | ||
116 | } | 118 | } |
117 | 119 | ||
118 | if (!m_scene.Contains(scene)) | 120 | if (!m_scene.Contains(scene)) |
@@ -585,10 +587,12 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
585 | 587 | ||
586 | private LLSDMap invokeRezAvatarCap(LLSDMap responseMap, string CapAddress, OGPState userState) | 588 | private LLSDMap invokeRezAvatarCap(LLSDMap responseMap, string CapAddress, OGPState userState) |
587 | { | 589 | { |
590 | |||
588 | 591 | ||
589 | WebRequest DeRezRequest = WebRequest.Create(CapAddress); | 592 | WebRequest DeRezRequest = WebRequest.Create(CapAddress); |
590 | DeRezRequest.Method = "POST"; | 593 | DeRezRequest.Method = "POST"; |
591 | DeRezRequest.ContentType = "application/xml+llsd"; | 594 | DeRezRequest.ContentType = "application/xml+llsd"; |
595 | |||
592 | 596 | ||
593 | LLSDMap RAMap = new LLSDMap(); | 597 | LLSDMap RAMap = new LLSDMap(); |
594 | LLSDMap AgentParms = new LLSDMap(); | 598 | LLSDMap AgentParms = new LLSDMap(); |
@@ -842,6 +846,22 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
842 | ta.Start(); | 846 | ta.Start(); |
843 | } | 847 | } |
844 | } | 848 | } |
849 | // Temporary hack to allow teleporting to and from Vaak | ||
850 | private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error) | ||
851 | { | ||
852 | |||
853 | //if (cert.Subject == "E=root@lindenlab.com, CN=*.vaak.lindenlab.com, O=\"Linden Lab, Inc.\", L=San Francisco, S=California, C=US") | ||
854 | //{ | ||
855 | |||
856 | return true; | ||
857 | |||
858 | //} | ||
859 | |||
860 | //return false; | ||
861 | |||
862 | } | ||
863 | |||
864 | |||
845 | } | 865 | } |
846 | 866 | ||
847 | public class KillAUser | 867 | public class KillAUser |