Revert generate removing

This commit is contained in:
Spitap
2023-06-21 21:10:50 +02:00
committed by Antoine Nguyen
parent 4759146d99
commit e900e6258f
2 changed files with 8 additions and 0 deletions

View File

@@ -30,6 +30,10 @@ ConfigDictTemplate = [
{
"name": "certificate",
"values": [
{
"option": "generate",
"default": "true",
},
{
"option": "type",
"default": "self-signed",

View File

@@ -148,6 +148,10 @@ class LetsEncryptCertificate(CertificateBackend):
def get_backend(config):
"""Return the appropriate backend."""
cert_type = config.get("certificate", "type")
condition = (not config.getboolean("certificate", "generate") and
cert_type != "manual")
if condition:
return None
if cert_type == "letsencrypt":
return LetsEncryptCertificate(config)
if cert_type == "manual":