Implementation of a basic PEM encoded to OpenSim compatible PKCS12 certificates converter.

As you know most CAs return PEM encoded certificates and require a conversion using OpenSSL to make them compatible with OpenSim.
This implementation does the automatic conversion from .pem to .p12 and .pfx at OpenSim startup which updates the certificate in case of automatic certificates renewal...
Note: still under testing using certbot and Let's Encrypt certs...

Thank you and good continuaion
Web Rain :)
This commit is contained in:
Adil El Farissi
2024-09-16 01:52:19 +00:00
parent 70f3b02f65
commit 52c77b2f12
4 changed files with 110 additions and 1 deletions

View File

@@ -367,6 +367,16 @@ namespace OpenSim
);
}
}
if(startupConfig.GetBoolean("EnableCertConverter", false))
{
Util.ConvertPemToPKCS12(
string.IsNullOrEmpty(startupConfig.GetString("outputCertName")) ? "letsencrypt" : startupConfig.GetString("outputCertName"),
string.IsNullOrEmpty(startupConfig.GetString("PemCertPublicKey")) ? string.Empty : startupConfig.GetString("PemCertPublicKey"),
string.IsNullOrEmpty(startupConfig.GetString("PemCertPrivateKey")) ? string.Empty : startupConfig.GetString("PemCertPrivateKey"),
string.IsNullOrEmpty(startupConfig.GetString("outputCertPassword")) ? string.Empty : startupConfig.GetString("outputCertPassword")
);
}
if(m_networkServersInfo.HttpUsesSSL)
{