From d01b17f1e2b65b374dccc1a827bcda1fd32324c8 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 28 May 2015 18:31:06 +0000 Subject: [PATCH] IInstaller.deploy_cert docs/naming fixes --- letsencrypt/interfaces.py | 9 +++++---- letsencrypt_apache/configurator.py | 11 +++-------- letsencrypt_nginx/configurator.py | 14 +++++--------- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/letsencrypt/interfaces.py b/letsencrypt/interfaces.py index fd4b3d25b..021e5063d 100644 --- a/letsencrypt/interfaces.py +++ b/letsencrypt/interfaces.py @@ -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 """ diff --git a/letsencrypt_apache/configurator.py b/letsencrypt_apache/configurator.py index 102718e13..40f570f80 100644 --- a/letsencrypt_apache/configurator.py +++ b/letsencrypt_apache/configurator.py @@ -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 diff --git a/letsencrypt_nginx/configurator.py b/letsencrypt_nginx/configurator.py index d2deee15a..f7b53f3fa 100644 --- a/letsencrypt_nginx/configurator.py +++ b/letsencrypt_nginx/configurator.py @@ -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