mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
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.
This commit is contained in:
committed by
UbitUmarov
parent
e2b655a939
commit
c2c3ca418a
@@ -352,7 +352,22 @@ 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.GetBoolean("EnbleSelfsignedCertSupport"))
|
||||
{
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user