aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2016-12-07 12:23:40 +0000
committerUbitUmarov2016-12-07 12:23:40 +0000
commit049dd374e9becc12b3e36e42d217f79ebf09ad45 (patch)
tree4fd68978cad7248cfe87585e62a5cb8d589069e2
parentMerge branch 'master' into httptests (diff)
downloadopensim-SC-049dd374e9becc12b3e36e42d217f79ebf09ad45.zip
opensim-SC-049dd374e9becc12b3e36e42d217f79ebf09ad45.tar.gz
opensim-SC-049dd374e9becc12b3e36e42d217f79ebf09ad45.tar.bz2
opensim-SC-049dd374e9becc12b3e36e42d217f79ebf09ad45.tar.xz
add SSL certs validation options for robust to allow simple certificates, possible only for encriptation without any peer autentification. disable validation by default for the small grids case
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/ServerMain.cs27
-rw-r--r--bin/Robust.HG.ini.example9
2 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs
index ed5a481..190f60f 100644
--- a/OpenSim/Server/ServerMain.cs
+++ b/OpenSim/Server/ServerMain.cs
@@ -30,6 +30,8 @@ using log4net;
30using System.Reflection; 30using System.Reflection;
31using System; 31using System;
32using System.Net; 32using System.Net;
33using System.Net.Security;
34using System.Security.Cryptography.X509Certificates;
33using System.Collections.Generic; 35using System.Collections.Generic;
34using OpenSim.Framework.Servers; 36using OpenSim.Framework.Servers;
35using OpenSim.Framework.Servers.HttpServer; 37using OpenSim.Framework.Servers.HttpServer;
@@ -51,6 +53,26 @@ namespace OpenSim.Server
51 new List<IServiceConnector>(); 53 new List<IServiceConnector>();
52 54
53 protected static PluginLoader loader; 55 protected static PluginLoader loader;
56 private static bool m_NoVerifyCertChain = false;
57 private static bool m_NoVerifyCertHostname = false;
58
59 public static bool ValidateServerCertificate(
60 object sender,
61 X509Certificate certificate,
62 X509Chain chain,
63 SslPolicyErrors sslPolicyErrors)
64 {
65 if (m_NoVerifyCertChain)
66 sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateChainErrors;
67
68 if (m_NoVerifyCertHostname)
69 sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateNameMismatch;
70
71 if (sslPolicyErrors == SslPolicyErrors.None)
72 return true;
73
74 return false;
75 }
54 76
55 public static int Main(string[] args) 77 public static int Main(string[] args)
56 { 78 {
@@ -69,6 +91,11 @@ namespace OpenSim.Server
69 throw new Exception("Configuration error"); 91 throw new Exception("Configuration error");
70 } 92 }
71 93
94 m_NoVerifyCertChain = serverConfig.GetBoolean("NoVerifyCertChain", m_NoVerifyCertChain);
95 m_NoVerifyCertHostname = serverConfig.GetBoolean("NoVerifyCertHostname", m_NoVerifyCertHostname);
96
97 ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
98
72 string connList = serverConfig.GetString("ServiceConnectors", String.Empty); 99 string connList = serverConfig.GetString("ServiceConnectors", String.Empty);
73 100
74 registryLocation = serverConfig.GetString("RegistryLocation","."); 101 registryLocation = serverConfig.GetString("RegistryLocation",".");
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example
index c231a8a..08a3b8c 100644
--- a/bin/Robust.HG.ini.example
+++ b/bin/Robust.HG.ini.example
@@ -70,6 +70,15 @@
70 ; How many lines of command history should we keep? (default is 100) 70 ; How many lines of command history should we keep? (default is 100)
71 ConsoleHistoryFileLines = 100 71 ConsoleHistoryFileLines = 100
72 72
73 ; peers SSL certificate validation options (if using ssl)
74 ; you should set this to false forcing all peers (like regions) to have valid certificates
75 ; but you can allow selfsigned certificates or no official CA with next option true
76 NoVerifyCertChain = true
77 ; you can also bypass the hostname or domain verification
78 NoVerifyCertHostname = true
79 ; having both options true does provide encriptation, but low security
80 ; possible enought for small grids, specially it not comercial
81
73 82
74[ServiceList] 83[ServiceList]
75 AssetServiceConnector = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:AssetServiceConnector" 84 AssetServiceConnector = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:AssetServiceConnector"