mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:02:52 +02:00
Revert pre-renewer deploy_certificate API
This commit is contained in:
+2
-3
@@ -103,7 +103,7 @@ def run(args, config, plugins):
|
|||||||
installer, plugins)
|
installer, plugins)
|
||||||
if not lineage:
|
if not lineage:
|
||||||
return "Certificate could not be obtained"
|
return "Certificate could not be obtained"
|
||||||
acme.deploy_certificate(doms, lineage)
|
acme.deploy_certificate(doms, lineage.privkey, lineage.cert, lineage.chain)
|
||||||
acme.enhance_config(doms, args.redirect)
|
acme.enhance_config(doms, args.redirect)
|
||||||
|
|
||||||
|
|
||||||
@@ -145,8 +145,7 @@ def install(args, config, plugins):
|
|||||||
acme, doms = _common_run(
|
acme, doms = _common_run(
|
||||||
args, config, acc, authenticator=None, installer=installer)
|
args, config, acc, authenticator=None, installer=installer)
|
||||||
assert args.cert_path is not None
|
assert args.cert_path is not None
|
||||||
# XXX: This API has changed as a result of RenewableCert!
|
acme.deploy_certificate(doms, acc.key, args.cert_path, args.chain_path)
|
||||||
# acme.deploy_certificate(doms, acc.key, args.cert_path, args.chain_path)
|
|
||||||
acme.enhance_config(doms, args.redirect)
|
acme.enhance_config(doms, args.redirect)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+9
-12
@@ -238,32 +238,29 @@ class Client(object):
|
|||||||
|
|
||||||
return os.path.abspath(act_cert_path), cert_chain_abspath
|
return os.path.abspath(act_cert_path), cert_chain_abspath
|
||||||
|
|
||||||
def deploy_certificate(self, domains, lineage):
|
def deploy_certificate(self, domains, privkey, cert_path, chain_path):
|
||||||
"""Install certificate
|
"""Install certificate
|
||||||
|
|
||||||
:param list domains: list of domains to install the certificate
|
:param list domains: list of domains to install the certificate
|
||||||
|
|
||||||
:param lineage: RenewableCert object representing the certificate
|
:param privkey: private key for certificate
|
||||||
:type lineage: :class:`letsencrypt.storage.RenewableCert`
|
:type privkey: :class:`letsencrypt.le_util.Key`
|
||||||
|
|
||||||
|
:param str cert_path: certificate file path (optional)
|
||||||
|
:param str chain_path: chain file path
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if self.installer is None:
|
if self.installer is None:
|
||||||
logging.warning("No installer specified, client is unable to deploy"
|
logging.warning("No installer specified, client is unable to deploy"
|
||||||
"the certificate")
|
"the certificate")
|
||||||
raise errors.LetsEncryptClientError("No installer available")
|
raise errors.LetsEncryptClientError("No installer available")
|
||||||
|
|
||||||
# TODO: Is it possible not to have a chain at all? (The
|
chain_path = None if chain_path is None else os.path.abspath(chain_path)
|
||||||
# RenewableCert class currently doesn't support this case, but
|
|
||||||
# perhaps the CA can issue according to ACME without providing
|
|
||||||
# a chain, which would currently be a problem for instantiating
|
|
||||||
# RenewableCert, and subsequently also for this method.)
|
|
||||||
|
|
||||||
for dom in domains:
|
for dom in domains:
|
||||||
# TODO: Provide a fullchain reference for installers like
|
# TODO: Provide a fullchain reference for installers like
|
||||||
# nginx that want it
|
# nginx that want it
|
||||||
self.installer.deploy_cert(dom,
|
self.installer.deploy_cert(dom, cert_path, privkey, chain_path)
|
||||||
lineage.cert,
|
|
||||||
lineage.privkey,
|
|
||||||
lineage.chain)
|
|
||||||
|
|
||||||
self.installer.save("Deployed Let's Encrypt Certificate")
|
self.installer.save("Deployed Let's Encrypt Certificate")
|
||||||
# sites may have been enabled / final cleanup
|
# sites may have been enabled / final cleanup
|
||||||
|
|||||||
Reference in New Issue
Block a user