mirror of
https://github.com/certbot/certbot.git
synced 2026-06-06 07:12:54 -04:00
See https://community.letsencrypt.org/t/ssl-error-after-cert-renew/99430. The first commit of this PR is a simple, clean revert of #7191. Subsequent commits add back pieces of that PR we want to keep. I also reverted #7299 which landed in a separate PR, but needs to be reverted to keep including the TLS config files in the certbot-apache package when it is built. I tested this on Ubuntu 18.04 by installing a cert to Apache using Certbot master and then running certbot renew with this branch. I watched the Apache plugin update the configuration file to remove SSLSessionTickets off. * Revert "Disable TLS session tickets for Apache 2.4.11+ (#7191)" This reverts commit9174c631d9. * Keep hashes with TLS session tickets disabled. * dont delete changelog entries * add changelog entry * Revert "Clean the useless entries in MANIFEST.in (#7299)" This reverts commitf4d17d9a6b. (cherry picked from commit120137eb8d)
75 lines
2.7 KiB
Python
75 lines
2.7 KiB
Python
""" Distribution specific override class for Gentoo Linux """
|
|
import pkg_resources
|
|
|
|
import zope.interface
|
|
|
|
from certbot import interfaces
|
|
|
|
from certbot_apache import apache_util
|
|
from certbot_apache import configurator
|
|
from certbot_apache import parser
|
|
|
|
@zope.interface.provider(interfaces.IPluginFactory)
|
|
class GentooConfigurator(configurator.ApacheConfigurator):
|
|
"""Gentoo specific ApacheConfigurator override class"""
|
|
|
|
OS_DEFAULTS = dict(
|
|
server_root="/etc/apache2",
|
|
vhost_root="/etc/apache2/vhosts.d",
|
|
vhost_files="*.conf",
|
|
logs_root="/var/log/apache2",
|
|
ctl="apache2ctl",
|
|
version_cmd=['apache2ctl', '-v'],
|
|
restart_cmd=['apache2ctl', 'graceful'],
|
|
restart_cmd_alt=['apache2ctl', 'restart'],
|
|
conftest_cmd=['apache2ctl', 'configtest'],
|
|
enmod=None,
|
|
dismod=None,
|
|
le_vhost_ext="-le-ssl.conf",
|
|
handle_modules=False,
|
|
handle_sites=False,
|
|
challenge_location="/etc/apache2/vhosts.d",
|
|
MOD_SSL_CONF_SRC=pkg_resources.resource_filename(
|
|
"certbot_apache", "options-ssl-apache.conf")
|
|
)
|
|
|
|
def _prepare_options(self):
|
|
"""
|
|
Override the options dictionary initialization in order to support
|
|
alternative restart cmd used in Gentoo.
|
|
"""
|
|
super(GentooConfigurator, self)._prepare_options()
|
|
self.options["restart_cmd_alt"][0] = self.option("ctl")
|
|
|
|
def get_parser(self):
|
|
"""Initializes the ApacheParser"""
|
|
return GentooParser(
|
|
self.option("server_root"), self.option("vhost_root"),
|
|
self.version, configurator=self)
|
|
|
|
|
|
class GentooParser(parser.ApacheParser):
|
|
"""Gentoo specific ApacheParser override class"""
|
|
def __init__(self, *args, **kwargs):
|
|
# Gentoo specific configuration file for Apache2
|
|
self.apacheconfig_filep = "/etc/conf.d/apache2"
|
|
super(GentooParser, self).__init__(*args, **kwargs)
|
|
|
|
def update_runtime_variables(self):
|
|
""" Override for update_runtime_variables for custom parsing """
|
|
self.parse_sysconfig_var()
|
|
self.update_modules()
|
|
|
|
def parse_sysconfig_var(self):
|
|
""" Parses Apache CLI options from Gentoo configuration file """
|
|
defines = apache_util.parse_define_file(self.apacheconfig_filep,
|
|
"APACHE2_OPTS")
|
|
for k in defines:
|
|
self.variables[k] = defines[k]
|
|
|
|
def update_modules(self):
|
|
"""Get loaded modules from httpd process, and add them to DOM"""
|
|
mod_cmd = [self.configurator.option("ctl"), "modules"]
|
|
matches = self.parse_from_subprocess(mod_cmd, r"(.*)_module")
|
|
for mod in matches:
|
|
self.add_mod(mod.strip())
|