diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index bbff3411b..03367e2cb 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -340,6 +340,9 @@ def _paths_parser(parser): add("--cert-dir", default=flag_default("certs_dir"), help=config_help("cert_dir")) + add("--renewer-config-file", default=flag_default("renewer_config_file"), + help=config_help("renewer_config_file")) + return parser diff --git a/letsencrypt/client.py b/letsencrypt/client.py index bd467b13d..310fbecfc 100644 --- a/letsencrypt/client.py +++ b/letsencrypt/client.py @@ -185,8 +185,19 @@ class Client(object): authenticator).name if installer is not None: self.config.namespace.installer = plugins.find_init(installer).name - return storage.RenewableCert.new_lineage( - domains[0], cert, privkey, chain, vars(self.config.namespace)) + + # XXX: We clearly need a more general and correct way of getting + # options into the configobj for the RenewableCert instance. + # This is a quick-and-dirty way to do it to allow integration + # testing to start. (Note that the config parameter to new_lineage + # ideally should be a ConfigObj, but in this case a dict will be + # accepted in practice.) + params = vars(self.config.namespace) + config = {"renewer_config_file": + params["renewer_config_file"]} if "renewer_config_file" in params else None + return storage.RenewableCert.new_lineage(domains[0], cert, privkey, + chain, params, config) + def save_certificate(self, certr, cert_path, chain_path): # pylint: disable=no-self-use diff --git a/letsencrypt/constants.py b/letsencrypt/constants.py index 88c043d1c..5b7c3af29 100644 --- a/letsencrypt/constants.py +++ b/letsencrypt/constants.py @@ -25,6 +25,7 @@ CLI_DEFAULTS = dict( certs_dir=_CLI_DEFAULT_CERT_DIR, cert_path=os.path.join(_CLI_DEFAULT_CERT_DIR, "cert-letsencrypt.pem"), chain_path=os.path.join(_CLI_DEFAULT_CERT_DIR, "chain-letsencrypt.pem"), + renewer_config_file=os.path.join(_CLI_DEFAULT_CONFIG_DIR, "renewer.conf"), test_mode=False, ) """Defaults for CLI flags and `.IConfig` attributes.""" diff --git a/letsencrypt/interfaces.py b/letsencrypt/interfaces.py index d13127691..365b9c182 100644 --- a/letsencrypt/interfaces.py +++ b/letsencrypt/interfaces.py @@ -174,6 +174,9 @@ class IConfig(zope.interface.Interface): key_dir = zope.interface.Attribute("Keys storage.") cert_dir = zope.interface.Attribute("Certificates and CSRs storage.") + renewer_config_file = zope.interface.Attribute( + "Location of renewal configuration file.") + test_mode = zope.interface.Attribute( "Test mode. Disables certificate verification.")