mirror of
https://github.com/certbot/certbot.git
synced 2026-01-21 19:01:07 +03:00
IInstaller.deploy_cert docs/naming fixes
This commit is contained in:
@@ -193,12 +193,13 @@ class IInstaller(IPlugin):
|
||||
def get_all_names():
|
||||
"""Returns all names that may be authenticated."""
|
||||
|
||||
def deploy_cert(domain, cert, key, cert_chain=None):
|
||||
def deploy_cert(domain, cert_path, key_path, chain_path=None):
|
||||
"""Deploy certificate.
|
||||
|
||||
:param str domain: domain to deploy certificate
|
||||
:param str cert: certificate filename
|
||||
:param str key: private key filename
|
||||
:param str domain: domain to deploy certificate file
|
||||
:param str cert_path: absolute path to the certificate file
|
||||
:param str key_path: absolute path to the private key file
|
||||
:param str chain_path: absolute path to the certificate chain file
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
|
||||
|
||||
temp_install(self.conf('mod-ssl-conf'))
|
||||
|
||||
def deploy_cert(self, domain, cert_path, key, chain_path=None):
|
||||
def deploy_cert(self, domain, cert_path, key_path, chain_path=None):
|
||||
"""Deploys certificate to specified virtual host.
|
||||
|
||||
Currently tries to find the last directives to deploy the cert in
|
||||
@@ -161,11 +161,6 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
|
||||
.. todo:: Might be nice to remove chain directive if none exists
|
||||
This shouldn't happen within letsencrypt though
|
||||
|
||||
:param str domain: domain to deploy certificate
|
||||
:param str cert_path: certificate filename
|
||||
:param str key: private key filename
|
||||
:param str chain_path: certificate chain filename
|
||||
|
||||
"""
|
||||
vhost = self.choose_vhost(domain)
|
||||
# TODO(jdkasten): vhost might be None
|
||||
@@ -192,7 +187,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
|
||||
logging.info("Deploying Certificate to VirtualHost %s", vhost.filep)
|
||||
|
||||
self.aug.set(path["cert_path"][0], cert_path)
|
||||
self.aug.set(path["cert_key"][0], key)
|
||||
self.aug.set(path["cert_key"][0], key_path)
|
||||
if chain_path is not None:
|
||||
if not path["chain_path"]:
|
||||
self.parser.add_dir(
|
||||
@@ -204,7 +199,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
|
||||
(vhost.filep,
|
||||
", ".join(str(addr) for addr in vhost.addrs)))
|
||||
self.save_notes += "\tSSLCertificateFile %s\n" % cert_path
|
||||
self.save_notes += "\tSSLCertificateKeyFile %s\n" % key
|
||||
self.save_notes += "\tSSLCertificateKeyFile %s\n" % key_path
|
||||
if chain_path is not None:
|
||||
self.save_notes += "\tSSLCertificateChainFile %s\n" % chain_path
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ class NginxConfigurator(common.Plugin):
|
||||
temp_install(self.conf('mod-ssl-conf'))
|
||||
|
||||
# Entry point in main.py for installing cert
|
||||
def deploy_cert(self, domain, cert, key, cert_chain=None):
|
||||
def deploy_cert(self, domain, cert_path, key_path, chain_path=None):
|
||||
# pylint: disable=unused-argument
|
||||
"""Deploys certificate to specified virtual host.
|
||||
|
||||
@@ -118,14 +118,10 @@ class NginxConfigurator(common.Plugin):
|
||||
|
||||
.. note:: This doesn't save the config files!
|
||||
|
||||
:param str domain: domain to deploy certificate
|
||||
:param str cert: certificate filename
|
||||
:param str key: private key filename
|
||||
:param str cert_chain: certificate chain filename
|
||||
|
||||
"""
|
||||
vhost = self.choose_vhost(domain)
|
||||
directives = [['ssl_certificate', cert], ['ssl_certificate_key', key]]
|
||||
directives = [['ssl_certificate', cert_path],
|
||||
['ssl_certificate_key', key_path]]
|
||||
|
||||
try:
|
||||
self.parser.add_server_directives(vhost.filep, vhost.names,
|
||||
@@ -143,8 +139,8 @@ class NginxConfigurator(common.Plugin):
|
||||
self.save_notes += ("Changed vhost at %s with addresses of %s\n" %
|
||||
(vhost.filep,
|
||||
", ".join(str(addr) for addr in vhost.addrs)))
|
||||
self.save_notes += "\tssl_certificate %s\n" % cert
|
||||
self.save_notes += "\tssl_certificate_key %s\n" % key
|
||||
self.save_notes += "\tssl_certificate %s\n" % cert_path
|
||||
self.save_notes += "\tssl_certificate_key %s\n" % key_path
|
||||
|
||||
#######################
|
||||
# Vhost parsing methods
|
||||
|
||||
Reference in New Issue
Block a user