Upstream changes through 9/5, 2024 (#91)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
dotnet package / build (8.0.x) (push) Has been cancelled
dotnet package / build (9.0.x) (push) Has been cancelled

* also add default uuid zero string to mysql and pgsql pbr entries

* add llDerezObject(..)

* update ScriptSyntax

* Postgresql Fixes: region store, mutelist and generic table handler.

Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>

* Fix wrong primary key on telehub spawn points. With the RegionUUID being created as a unique primary key only one spawn point could be created. Replaced the primary key with one using multiple columns to guarantee that each spawn point occupies a unique space in the region.

Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>

* Fix region data loading to prevent deletion of telehub spawnpoints

Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>

* Adding missing 'regionextra' table and associated handlers to the PgSQL adapter.

Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>

* viewers now are sending a useless flood of agent updates. Ignore some

* fix shared group object item modify permission check

* Add llGetNotecardLineSync

* a few changes to llGetNotecardLineSync

* minor cleanup

* fix typo

* improve script cpu time resolution specially on windows

* catch some possible null refs

* mantis 9135: avoid null ref

* another null ref, thx Tampa

* another typo, thx Tampa

* verify vivox requests

* Basic implementation of SSL selfsigned certificates creation and renewal

Allows selfsigned certificates creation and renewal for local and external use. When enabled, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\. Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificates in SSL\ssl\ folder. Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.

Note: The SSL related params in the network section was adapted to be user friendly and allow the usage just by uncommenting the SSL params in both sections and a password change.

* Add selfsigned certificates support to Robust and osGetLinkInventoryKeys plus some fixes

* Revert some default params and fixes to SSL support

* a few changes. in same cases http/https can't be determined. possible both need to be present, possible with http a redir to https. TODO

* ... in same cases http/https can't be determined. possible both need to be present, possible with http a redir to https. TODO

* fixed check of EnableSelfsignedCertSupport option

* Upstream changes through Aug 26, 2024

* mantis 9159: ignore spaces in z on cast string to vector

* mantis 9159: same on rotation s

* mantis 9158: allow it on prim inv to non-mod prim inventory if same owner and allowdrop was set on target

* Address CodeQL feedback "variable may be null"

---------

Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
Co-authored-by: UbitUmarov <ajlduarte@sapo.pt>
Co-authored-by: BlueWall <jamesh@bluewallvirtual.com>
Co-authored-by: Sue Cripter <Sue.Cripter@gmail.com>
Co-authored-by: Adil El Farissi <144741970+AdilElFarissi@users.noreply.github.com>
This commit is contained in:
Mike Dickson 2024-09-05 14:22:13 -04:00 committed by GitHub
parent 8b2a5673ee
commit 07a56b489d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 397 additions and 129 deletions

View file

@ -1,43 +0,0 @@
# hey, emacs! this is a -*- makefile -*-
#
# OpenSim makefile
#
RUBY = $(strip $(shell which ruby 2>/dev/null))
ifeq ($(RUBY),)
NANT = nant
else
NANT = $(shell if test "$$EMACS" = "t" ; then echo "nant"; else echo "./nant-color"; fi)
endif
all: prebuild
# @export PATH=/usr/local/bin:$(PATH)
${NANT}
find OpenSim -name \*.mdb -exec cp {} bin \;
release: prebuild
${NANT} -D:project.config=Release
find OpenSim -name \*.mdb -exec cp {} bin \;
prebuild:
./runprebuild.sh
clean:
# @export PATH=/usr/local/bin:$(PATH)
-${NANT} clean
test: prebuild
${NANT} test
test-xml: prebuild
${NANT} test-xml
tags:
find OpenSim -name \*\.cs | xargs etags
cscope-tags:
find OpenSim -name \*\.cs -fprint cscope.files
cscope -b
include $(wildcard Makefile.local)

View file

@ -569,7 +569,6 @@ ALTER TABLE `regionsettings` ADD COLUMN `TerrainPBR4` varchar(36) NOT NULL DEFAU
COMMIT;
:VERSION 67 #----- Add allow unsit and scripted sit only
BEGIN;
ALTER TABLE `prims`
ADD COLUMN `AllowUnsit` TINYINT(3) NULL DEFAULT '1',

View file

@ -983,9 +983,9 @@ namespace OpenSim.Data.PGSQL
command.Parameters.AddRange(CreateRegionSettingParameters(regionSettings));
command.ExecuteNonQuery();
command.Transaction.Commit();
}
}
catch (Exception e)
{
{
Console.WriteLine(e);
command.Transaction.Rollback();
throw;

View file

@ -308,7 +308,7 @@ namespace OpenSim.Framework.Servers.HttpServer
if(htype == UriHostNameType.Unknown || htype == UriHostNameType.Basic)
return false;
if(htype == UriHostNameType.Dns)
if(htype == UriHostNameType.Dns || htype == UriHostNameType.IPv4)
{
foreach(string name in m_certNames)
{

View file

@ -56,6 +56,7 @@ using OpenMetaverse.StructuredData;
using Amib.Threading;
using System.Collections.Concurrent;
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
namespace OpenSim.Framework
{
@ -1098,14 +1099,18 @@ namespace OpenSim.Framework
/// Is the platform Windows?
/// </summary>
/// <returns>true if so, false otherwise</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsWindows()
{
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
/*
PlatformID platformId = Environment.OSVersion.Platform;
return (platformId == PlatformID.Win32NT
|| platformId == PlatformID.Win32S
|| platformId == PlatformID.Win32Windows
|| platformId == PlatformID.WinCE);
*/
}
public static bool LoadArchSpecificWindowsDll(string libraryName)
@ -1480,6 +1485,71 @@ namespace OpenSim.Framework
return streamReader.ReadToEnd();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void CreateOrUpdateSelfsignedCert(string certFileName, string certHostName, string certHostIp, string certPassword)
{
CreateOrUpdateSelfsignedCertificate(certFileName, certHostName, certHostIp, certPassword);
}
/// <summary>
/// Create or renew an SSL selfsigned certificate using the parameters set in the startup section of OpenSim.ini
/// </summary>
/// <param name="certFileName">The certificate file name.</param>
/// <param name="certHostName">The certificate host DNS name (CN).</param>
/// <param name="certHostIp">The certificate host IP address.</param>
/// <param name="certPassword">The certificate password.</param>
private static void CreateOrUpdateSelfsignedCertificate(string certFileName, string certHostName, string certHostIp, string certPassword)
{
SubjectAlternativeNameBuilder san = new();
san.AddDnsName(certHostName);
san.AddIpAddress(IPAddress.Parse(certHostIp));
// What OpenSim check (CN).
X500DistinguishedName dn = new($"CN={certHostName}");
using (RSA rsa = RSA.Create(2048))
{
CertificateRequest request = new(dn, rsa, HashAlgorithmName.SHA256,RSASignaturePadding.Pkcs1);
// (Optional)...
request.CertificateExtensions.Add(
new X509KeyUsageExtension(X509KeyUsageFlags.DataEncipherment | X509KeyUsageFlags.KeyEncipherment | X509KeyUsageFlags.DigitalSignature , false));
// (Optional) SSL Server Authentication...
request.CertificateExtensions.Add(
new X509EnhancedKeyUsageExtension(
new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, false));
request.CertificateExtensions.Add(san.Build());
X509Certificate2 certificate = request.CreateSelfSigned(new DateTimeOffset(DateTime.UtcNow), new DateTimeOffset(DateTime.UtcNow.AddDays(3650)));
string privateKey = Convert.ToBase64String(rsa.ExportRSAPrivateKey(), Base64FormattingOptions.InsertLineBreaks);
// Create the SSL folder and sub folders if not exists.
if (!Directory.Exists("SSL\\src\\"))
Directory.CreateDirectory("SSL\\src\\");
if (!Directory.Exists("SSL\\ssl\\"))
Directory.CreateDirectory("SSL\\ssl\\");
// Store the RSA key in SSL\src\
File.WriteAllText($"SSL\\src\\{certFileName}.txt", privateKey);
// Export and store the .pfx and .p12 certificates in SSL\ssl\.
// Note: Pfx is a Pkcs12 certificate and both files work for OpenSim.
byte[] pfxCertBytes = string.IsNullOrEmpty(certPassword)
? certificate.Export(X509ContentType.Pfx)
: certificate.Export(X509ContentType.Pfx, certPassword);
File.WriteAllBytes($"SSL\\ssl\\{certFileName}.pfx", pfxCertBytes);
byte[] p12CertBytes = string.IsNullOrEmpty(certPassword)
? certificate.Export(X509ContentType.Pkcs12)
: certificate.Export(X509ContentType.Pkcs12, certPassword);
File.WriteAllBytes($"SSL\\ssl\\{certFileName}.p12", p12CertBytes);
}
}
public static int fast_distance2d(int x, int y)
{
x = Math.Abs(x);
@ -3034,6 +3104,39 @@ namespace OpenSim.Framework
return false;
}
[DllImport("winmm.dll")]
private static extern uint timeBeginPeriod(uint period);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void TimeBeginPeriod(uint period)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
timeBeginPeriod(period);
}
[DllImport("winmm.dll")]
private static extern uint timeEndPeriod(uint period);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void TimeEndPeriod(uint period)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
timeEndPeriod(period);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void ThreadSleep(int period)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
timeEndPeriod(1);
Thread.Sleep(period);
timeEndPeriod(1);
}
else
Thread.Sleep(period);
}
/// <summary>
/// Used to trigger an early library load on Windows systems.
/// </summary>

View file

@ -285,7 +285,7 @@ namespace OpenSim
Uri configUri;
return Uri.TryCreate(file, UriKind.Absolute,
out configUri) && configUri.Scheme == Uri.UriSchemeHttp;
out configUri) && (configUri.Scheme == Uri.UriSchemeHttp || configUri.Scheme == Uri.UriSchemeHttps);
}
/// <summary>

View file

@ -352,7 +352,25 @@ namespace OpenSim
IConfig startupConfig = Config.Configs["Startup"];
if (startupConfig == null || startupConfig.GetBoolean("JobEngineEnabled", true))
WorkManager.JobEngine.Start();
// Sure is not the right place for this but do the job...
// Must always be called before (all) / the HTTP servers starting for the Certs creation or renewals.
if (startupConfig is not null)
{
if (startupConfig.GetBoolean("EnableSelfsignedCertSupport", false))
{
if(!File.Exists("SSL\\ssl\\"+ startupConfig.GetString("CertFileName") +".p12") || startupConfig.GetBoolean("CertRenewOnStartup"))
{
Util.CreateOrUpdateSelfsignedCert(
string.IsNullOrEmpty(startupConfig.GetString("CertFileName")) ? "OpenSim" : startupConfig.GetString("CertFileName"),
string.IsNullOrEmpty(startupConfig.GetString("CertHostName")) ? "localhost" : startupConfig.GetString("CertHostName"),
string.IsNullOrEmpty(startupConfig.GetString("CertHostIp")) ? "127.0.0.1" : startupConfig.GetString("CertHostIp"),
string.IsNullOrEmpty(startupConfig.GetString("CertPassword")) ? string.Empty : startupConfig.GetString("CertPassword")
);
}
}
}
if(m_networkServersInfo.HttpUsesSSL)
{
m_httpServerSSL = true;

View file

@ -92,6 +92,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
protected bool m_enabled = false;
protected string m_ErrorStr;
protected uint m_HttpsPort = 0;
protected uint m_HttpPort = 0;
protected IHttpServer m_HttpServer = null;
protected IHttpServer m_HttpsServer = null;
@ -134,6 +135,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
bool ssl_enabled = config.Configs["Network"].GetBoolean("https_listener", false);
m_HttpPort = (uint)config.Configs["Network"].GetInt("http_listener_port", 9000);
if (ssl_enabled)
m_HttpsPort = (uint)config.Configs["Network"].GetInt("https_port", (int)m_HttpsPort);
}
@ -180,7 +183,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
{
// There can only be one
//
m_HttpServer = MainServer.Instance;
m_HttpServer = MainServer.GetHttpServer(m_HttpPort);
//
// We can use the https if it is enabled
if (m_HttpsPort > 0)

View file

@ -2336,9 +2336,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return false;
}
bool notSameOwner = srcsog.OwnerID.NotEqual(destsog.OwnerID);
if(notSameOwner)
if(srcsog.OwnerID.NotEqual(destsog.OwnerID))
{
if((itperms & (uint)PermissionMask.Transfer) == 0)
return false;
@ -2350,7 +2348,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
}
else
{
if((destsogEffectiveOwnerPerms & (uint)PermissionMask.Modify) == 0)
if((destsogEffectiveOwnerPerms & (uint)PermissionMask.Modify) == 0 &&
(destsog.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0)
return false;
}

View file

@ -5169,35 +5169,35 @@ namespace OpenSim.Region.Framework.Scenes
try
{
float time = 0.0f;
float time = 0.0f;
// get all the scripts in all parts
SceneObjectPart[] parts = m_parts.GetArray();
List<TaskInventoryItem> scripts = new();
for (int i = 0; i < parts.Length; i++)
{
// get all the scripts in all parts
SceneObjectPart[] parts = m_parts.GetArray();
List<TaskInventoryItem> scripts = new();
for (int i = 0; i < parts.Length; i++)
{
IEntityInventory inv = parts[i].Inventory;
if (inv is not null)
scripts.AddRange(parts[i].Inventory.GetInventoryItems(InventoryType.LSL));
}
// extract the UUIDs
HashSet<UUID> unique = new();
foreach (TaskInventoryItem script in scripts)
unique.Add(script.ItemID);
List<UUID> ids = unique.ToList();
// Offer the list of script UUIDs to each engine found and accumulate the time
foreach (IScriptModule e in engines)
{
if (e is not null)
{
time += e.GetScriptExecutionTime(ids);
scripts.AddRange(parts[i].Inventory.GetInventoryItems(InventoryType.LSL));
}
// extract the UUIDs
HashSet<UUID> unique = new();
foreach (TaskInventoryItem script in scripts)
unique.Add(script.ItemID);
List<UUID> ids = unique.ToList();
// Offer the list of script UUIDs to each engine found and accumulate the time
foreach (IScriptModule e in engines)
{
if (e is not null)
{
time += e.GetScriptExecutionTime(ids);
}
}
return time;
}
return time;
}
catch
{
return 0.0f;
@ -5213,40 +5213,39 @@ namespace OpenSim.Region.Framework.Scenes
try
{
// get all the scripts in all parts
SceneObjectPart[] parts = m_parts.GetArray();
List<TaskInventoryItem> scripts = new();
for (int i = 0; i < parts.Length; i++)
{
// get all the scripts in all parts
SceneObjectPart[] parts = m_parts.GetArray();
List<TaskInventoryItem> scripts = new();
for (int i = 0; i < parts.Length; i++)
{
IEntityInventory inv = parts[i].Inventory;
if(inv is not null)
scripts.AddRange(inv.GetInventoryItems(InventoryType.LSL));
}
if (scripts.Count == 0)
return false;
// extract the UUIDs
HashSet<UUID> unique = new();
foreach (TaskInventoryItem script in scripts)
unique.Add(script.ItemID);
List<UUID> ids = unique.ToList();
// Offer the list of script UUIDs to each engine found and accumulate the memory
foreach (IScriptModule e in engines)
{
if (e is not null)
{
memory += e.GetScriptsMemory(ids);
}
if (scripts.Count == 0)
return false;
// extract the UUIDs
HashSet<UUID> unique = new();
foreach (TaskInventoryItem script in scripts)
unique.Add(script.ItemID);
List<UUID> ids = unique.ToList();
// Offer the list of script UUIDs to each engine found and accumulate the memory
foreach (IScriptModule e in engines)
{
if (e is not null)
{
memory += e.GetScriptsMemory(ids);
}
}
return true;
}
return true;
}
catch
{
return false;
}
}
/// <summary>

View file

@ -66,7 +66,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
//private static readonly string m_chatSessionRequestPath = "0209/";
// Control info
private static bool m_Enabled = false;
private static bool m_Enabled = false;
// FreeSwitch server is going to contact us and ask us all
// sorts of things.
@ -111,8 +111,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
try
{
string serviceDll = m_Config.GetString("LocalServiceModule",
String.Empty);
string serviceDll = m_Config.GetString("LocalServiceModule", String.Empty);
if (serviceDll.Length == 0)
{
@ -325,6 +324,25 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
m_log.DebugFormat(
"[FreeSwitchVoice][PROVISIONVOICE]: ProvisionVoiceAccountRequest() request for {0}", agentID.ToString());
Stream inputStream = request.InputStream;
if (inputStream.Length > 0)
{
OSD tmp = OSDParser.DeserializeLLSDXml(inputStream);
request.InputStream.Dispose();
if (tmp is OSDMap map)
{
if (map.TryGetValue("voice_server_type", out OSD vstosd))
{
if (vstosd is OSDString vst && !((string)vst).Equals("vivox", StringComparison.OrdinalIgnoreCase))
{
response.RawBuffer = Util.UTF8.GetBytes("<llsd><undef /></llsd>");
return;
}
}
}
}
response.StatusCode = (int)HttpStatusCode.OK;
ScenePresence avatar = scene.GetScenePresence(agentID);

View file

@ -459,6 +459,25 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
response.StatusCode = (int)HttpStatusCode.OK;
try
{
Stream inputStream = request.InputStream;
if (inputStream.Length > 0)
{
OSD tmp = OSDParser.DeserializeLLSDXml(inputStream);
request.InputStream.Dispose();
if (tmp is OSDMap map)
{
if (map.TryGetValue("voice_server_type", out OSD vstosd))
{
if (vstosd is OSDString vst && !((string)vst).Equals("vivox", StringComparison.OrdinalIgnoreCase))
{
response.RawBuffer = Util.UTF8.GetBytes("<llsd><undef /></llsd>");
return;
}
}
}
}
ScenePresence avatar = null;
string avatarName = null;

View file

@ -13857,7 +13857,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ScenePresence presence = World.GetScenePresence(agentID);
// we are not interested in child-agents
if (presence.IsChildAgent)
if (presence is null || presence.IsChildAgent)
return;
presence.ControllingClient.SendClearFollowCamProperties(objectID);
@ -20548,7 +20548,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return new LSL_Integer(1);
}
}
}
public class NotecardCache
{

View file

@ -5561,6 +5561,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return LSL_String.NullKey;
}
public LSL_List osGetLinkInventoryKeys(LSL_Integer linkNumber, LSL_Integer type)
{
LSL_List ret = new();
SceneObjectPart part = GetSingleLinkPart(linkNumber);
if(part == null)
return ret;
part.TaskInventory.LockItemsForRead(true);
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in part.TaskInventory)
{
if (inv.Value.Type == type || type == -1 &&
(inv.Value.CurrentPermissions
& (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
== (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
ret.Add(inv.Value.AssetID.ToString());
}
part.TaskInventory.LockItemsForRead(false);
return ret;
}
public LSL_Key osGetLinkInventoryItemKey(LSL_Integer linkNumber, LSL_String name)
{
SceneObjectPart part = GetSingleLinkPart(linkNumber);

View file

@ -562,6 +562,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId);
LSL_Key osGetInventoryItemKey(LSL_String name);
LSL_Key osGetLinkInventoryKey(LSL_Integer linkNumber, LSL_String name, LSL_Integer type);
LSL_List osGetLinkInventoryKeys(LSL_Integer linkNumber, LSL_Integer type);
LSL_Key osGetLinkInventoryItemKey(LSL_Integer linkNumber, LSL_String name);
LSL_String osGetInventoryName(LSL_Key itemId);
LSL_String osGetLinkInventoryName(LSL_Integer linkNumber, LSL_Key itemId);

View file

@ -1465,6 +1465,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
return m_OSSL_Functions.osGetLinkInventoryKey(linkNumber, name, type);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_List osGetLinkInventoryKeys(LSL_Integer linkNumber, LSL_Integer type)
{
return m_OSSL_Functions.osGetLinkInventoryKeys(linkNumber, type);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_Key osGetLinkInventoryItemKey(LSL_Integer linkNumber, LSL_String name)

View file

@ -154,7 +154,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
while (++comma < str.Length)
{
c = Unsafe.Add(ref MemoryMarshal.GetReference(str), comma);
if (c == ' ' || c == '>')
if (c == '>')
break;
}
@ -575,7 +575,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
while (++comma < str.Length)
{
c = Unsafe.Add(ref MemoryMarshal.GetReference(str), comma);
if (c == ' ' || c == '>')
if (c == '>')
break;
}

View file

@ -138,7 +138,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
// guards m_DetachQuantum, m_EventQueue, m_EventCounts, m_Running, m_Suspended
public Object m_QueueLock = new Object();
// true iff allowed to accept new events
// true if allowed to accept new events
public bool m_Running = true;
// queue of events that haven't been acted upon yet

View file

@ -133,6 +133,19 @@ namespace OpenSim.Server.Base
m_configDirectory = startupConfig.GetString("ConfigDirectory", m_configDirectory);
prompt = startupConfig.GetString("Prompt", prompt);
if(startupConfig.GetBoolean("EnableRobustSelfsignedCertSupport", false))
{
if(!File.Exists("SSL\\ssl\\"+ startupConfig.GetString("RobustCertFileName") +".p12") || startupConfig.GetBoolean("RobustCertRenewOnStartup"))
{
Util.CreateOrUpdateSelfsignedCert(
string.IsNullOrEmpty(startupConfig.GetString("RobustCertFileName")) ? "Robust" : startupConfig.GetString("RobustCertFileName"),
string.IsNullOrEmpty(startupConfig.GetString("RobustCertHostName")) ? "localhost" : startupConfig.GetString("RobustCertHostName"),
string.IsNullOrEmpty(startupConfig.GetString("RobustCertHostIp")) ? "127.0.0.1" : startupConfig.GetString("RobustCertHostIp"),
string.IsNullOrEmpty(startupConfig.GetString("RobustCertPassword")) ? string.Empty : startupConfig.GetString("RobustCertPassword")
);
}
}
}
// Allow derived classes to load config before the console is opened.
ReadConfig();
@ -327,7 +340,7 @@ namespace OpenSim.Server.Base
Uri configUri;
return Uri.TryCreate(file, UriKind.Absolute,
out configUri) && configUri.Scheme == Uri.UriSchemeHttp;
out configUri) && (configUri.Scheme == Uri.UriSchemeHttp || configUri.Scheme == Uri.UriSchemeHttps);
}
IConfigSource ReadConfigSource(string iniFile)
@ -340,7 +353,7 @@ namespace OpenSim.Server.Base
try
{
if (Uri.TryCreate(iniFile, UriKind.Absolute, out configUri) &&
configUri.Scheme == Uri.UriSchemeHttp)
(configUri.Scheme == Uri.UriSchemeHttp || configUri.Scheme == Uri.UriSchemeHttps))
{
XmlReader r = XmlReader.Create(iniFile);
s = new XmlConfigSource(r);

View file

@ -201,7 +201,7 @@ namespace OpenSim.Tools.Configger
Uri configUri;
return Uri.TryCreate(file, UriKind.Absolute,
out configUri) && configUri.Scheme == Uri.UriSchemeHttp;
out configUri) && (configUri.Scheme == Uri.UriSchemeHttp || configUri.Scheme == Uri.UriSchemeHttps);
}
/// <summary>

View file

@ -52,7 +52,7 @@
;# {BaseHostname} {} {BaseHostname} {"example.com" "127.0.0.1"} "127.0.0.1"
BaseHostname = "127.0.0.1"
;# {BaseURL} {} {BaseURL} {"http://${Const|BaseHostname}} "http://${Const|BaseHostname}"
;# {BaseURL} {} {BaseURL} {"http://${Const|BaseHostname"}} "http://${Const|BaseHostname}"
BaseURL = http://${Const|BaseHostname}
; If you run a grid, several services should not be availble to world, access to them should be blocked on firewall
@ -310,6 +310,35 @@
; TelehubAllowLandmark = false
;; SSL selfsigned certificate settings.
;; Enable selfsigned certificate creation for local and external use. When set to true, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\.
;; Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificate in SSL\ssl\ folder.
;;Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.
;# {EnbleSelfsignedCertSupport} {} {Enable selfsigned certificate creation and renew} {true false} false
EnableSelfsignedCertSupport = false
;; Renew the selfsigned certificate on every server startup ?
;# {CertRenewOnStartup} {} {renew the selfsigned certificate on the server startup} {true false} true
CertRenewOnStartup = false
;; Certificate options:
;; Set the certificate file name. the output files extensions are CertFileName.p12 and CertFileName.pfx.
;# {CertFileName} {} {set the certificate file name} {} "OpenSim"
CertFileName = "OpenSim"
;; Set the certificate password.
;# {CertPassword} {} {set the certificate password} {} ""
CertPassword = "mycertpass"
;; The certificate host name (domain or IP of this machine CN). Must be the same as "ExternalHostName" in Regions.ini
;# {CertHostName} {} {set the certificate host name} {} "myRegionsExternalHostName"
CertHostName = "myRegionsExternalHostName"
;; The certificate host IP (IP of this machine).
;# {CertHostIp} {} {set the certificate host IP} {}
CertHostIp = "127.0.0.1"
;; SSL certificate validation options
;; you can allow selfsigned certificates or no official CA with next option set to true
;# {NoVerifyCertChain} {} {do not verify SSL Cert Chain} {true false} true
@ -418,7 +447,7 @@
;;
;; If set to false, then, in theory, the server never carries out
;; permission checks (allowing anybody to copy
;; any item, etc. This may not yet be implemented uniformally.
;; any item, etc). This may not yet be implemented uniformally.
;; If set to true, then all permissions checks are carried out
; serverside_object_permissions = true
@ -581,24 +610,24 @@
; the main unsecure port will still open for some services. this may change in future.
; set http_listener_ssl to enable main server ssl. it will replace unsecure port on most functions
;# {http_listener_ssl}{} {enable main server ssl port)} {} false
;# {http_listener_ssl}{} {enable main server ssl port} {} false
;http_listener_ssl = false
; Set port for main SSL connections
;# {http_listener_sslport}{} {main server ssl port)} {} 9001
;# {http_listener_sslport}{} {main server ssl port} {} 9001
;http_listener_sslport = 9001 ;
; currently if using ssl, regions ExternalHostName must the the same and equal to http_listener_cn
; this may be removed in future
;# {http_listener_cn}{} {main server ssl externalHostName)} {} ""
;# {http_listener_cn}{} {main server ssl externalHostName} {} ""
;http_listener_cn = "myRegionsExternalHostName"
; the path for the certificate path
;# {http_listener_cert_path}{} {main server ssl certificate file path)} {} ""
;http_listener_cert_path = "mycert.p12"
;# {http_listener_cert_path}{} {main server ssl certificate file path} {} ""
;http_listener_cert_path = "SSL\ssl\OpenSim.p12"
;# {http_listener_cert_pass}{} {main server ssl certificate password)} {} ""
;http_listener_cert_pass = "mycertpass" ; the cert passwork
;# {http_listener_cert_pass}{} {main server ssl certificate password} {} ""
;http_listener_cert_pass = "mycertpass"
; By default, OpenSimulator does not allow scripts to make HTTP calls to addresses on the simulator's LAN.
; See the OutboundDisallowForUserScripts parameter in OpenSimDefaults.ini for more information on this filter.

View file

@ -399,6 +399,31 @@
; routing and land at the landmark coordinates when set to true
; default is false
; TelehubAllowLandmark = false
; #
; # SSL selfsigned certificate settings.
; #
; Enable selfsigned certificate creation for local and external use. When set to true, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\.
; Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificate in SSL\ssl\ folder.
; Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.
EnableSelfsignedCertSupport = false
;Renew the selfsigned certificate on every server startup ?
CertRenewOnStartup = false
; # Certificate options:
; Set the certificate file name. the output files extensions are CertFileName.p12 and CertFileName.pfx.
CertFileName = "OpenSim"
; Set the certificate password.
CertPassword = "mycertpass"
; The certificate host name (domain or IP of this machine CN). Must be the same as "ExternalHostName" in Regions.ini
CertHostName = "myRegionsExternalHostName"
; The certificate host IP (IP of this machine).
CertHostIp = "127.0.0.1"
; #
; # SSL certificates validation options

View file

@ -23,9 +23,15 @@
; * uses to write data.
; *
[Const]
; The domain or IP of the Robust server.
BaseHostname = "127.0.0.1"
; The URL of the Robust server
BaseURL = "http://127.0.0.1"
; The http URL of the Robust server.
BaseURL = "http://${Const|BaseHostname}"
; The https URL of the Robust server.
; Use this if you have the SSL enabled.
; BaseURL = "https://${Const|BaseHostname}"
; The public port of the Robust server
PublicPort = "8002"
@ -72,7 +78,29 @@
; Time stamp commands in history file (default false)
; ConsoleHistoryTimeStamp = false
;; SSL selfsigned certificate settings.
; Enable selfsigned certificate creation for local and external use. When set to true, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\.
; Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificate in SSL\ssl\ folder.
; Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.
EnableRobustSelfsignedCertSupport = false
;Renew the selfsigned certificate on every server startup ?
RobustCertRenewOnStartup = false
;; Certificate options:
; Set the certificate file name. the output files extensions are CertFileName.p12 and RobustCertFileName.pfx. This must be different than CertFileName in OpenSim.ini
RobustCertFileName = "Robust"
; Set the certificate password.
RobustCertPassword = "mycertpass"
; The certificate host name (CN).
RobustCertHostName = ${Const|BaseHostname}
; The certificate host IP.
RobustCertHostIp = "127.0.0.1"
; peers SSL certificate validation options
; you can allow selfsigned certificates or no official CA with next option set to true
NoVerifyCertChain = true

View file

@ -15,8 +15,15 @@
; *
[Const]
; The URL of the Robust server
BaseURL = "http://127.0.0.1"
; The domain or IP of the Robust server.
BaseHostname = "127.0.0.1"
; The http URL of the Robust server.
BaseURL = "http://${Const|BaseHostname}"
; The https URL of the Robust server.
; Use this if you have the SSL enabled.
; BaseURL = "https://${Const|BaseHostname}"
; The public port of the Robust server
PublicPort = "8002"
@ -64,7 +71,29 @@
; Time stamp commands in history file (default false)
; ConsoleHistoryTimeStamp = false
;; SSL selfsigned certificate settings.
; Enable selfsigned certificate creation for local and external use. When set to true, will create a folder SSL\ and 2 sub folders SSL\ssl\ and SSL\src\.
; Next creates and store an RSA private key in SSL\src\ and the derived selfsigned certificate in SSL\ssl\ folder.
; Is also possible to renew the certificate on every server restart if CertRenewOnStartup is set to true.
EnableRobustSelfsignedCertSupport = false
; Renew the selfsigned certificate on every server startup ?
RobustCertRenewOnStartup = false
;; Certificate options:
; Set the certificate file name. the output files extensions are RobustCertFileName.p12 and RobustCertFileName.pfx.
RobustCertFileName = "Robust"
; Set the certificate password.
RobustCertPassword = "mycertpass"
; The certificate host name (CN).
RobustCertHostName = ${Const|BaseHostname}
; The certificate host IP.
RobustCertHostIp = "127.0.0.1"
; peers SSL certificate validation options
; you can allow selfsigned certificates or no official CA with next option set to true
NoVerifyCertChain = true