diff --git a/letsencrypt/client/apache_configurator.py b/letsencrypt/client/apache_configurator.py index 1a3cd73b7..c200a3a1e 100644 --- a/letsencrypt/client/apache_configurator.py +++ b/letsencrypt/client/apache_configurator.py @@ -17,9 +17,6 @@ from letsencrypt.client import le_util from letsencrypt.client import logger -options_ssl_conf = pkg_resources.resource_filename(__name__, os.path.basename(CONFIG.OPTIONS_SSL_CONF)) - - # Configurator should be turned into a Singleton # Note: Apache 2.4 NameVirtualHost directive is deprecated... all vhost twins @@ -615,7 +612,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): self.add_dir(vh_p[0], "SSLCertificateFile", "/etc/ssl/certs/ssl-cert-snakeoil.pem") self.add_dir(vh_p[0], "SSLCertificateKeyFile", "/etc/ssl/private/ssl-cert-snakeoil.key") - self.add_dir(vh_p[0], "Include", options_ssl_conf) + self.add_dir(vh_p[0], "Include", OPTIONS_SSL_CONF) # Log actions and create save notes logger.info("Created an SSL vhost at %s" % ssl_fp) @@ -1152,7 +1149,7 @@ SSLStrictSNIVHostCheck on \n \ \n \ LimitRequestBody 1048576 \n \ \n \ -Include " + options_ssl_conf + " \n \ +Include " + OPTIONS_SSL_CONF + " \n \ SSLCertificateFile " + self.dvsni_get_cert_file(nonce) + " \n \ SSLCertificateKeyFile " + key + " \n \ \n \ @@ -1173,6 +1170,13 @@ DocumentRoot " + CONFIG.CONFIG_DIR + "challenge_page/ \n \ result: Apache config includes virtual servers for issued challenges """ + + # Check to make sure options-ssl.conf is installed + if not os.path.isfile(CONFIG.OPTIONS_SSL_CONF): + dist_conf = pkg_resources.resource_filename( + __name__, os.path.basename(CONFIG.OPTIONS_SSL_CONF)) + shutil.copyfile(dist_conf, CONFIG.OPTIONS_SSL_CONF) + # TODO: Use ip address of existing vhost instead of relying on FQDN configText = " \n" for idx, lis in enumerate(listlistAddrs):