diff --git a/certbot-apache/certbot_apache/_internal/configurator.py b/certbot-apache/certbot_apache/_internal/configurator.py index 67b89e788..8b09e0637 100644 --- a/certbot-apache/certbot_apache/_internal/configurator.py +++ b/certbot-apache/certbot_apache/_internal/configurator.py @@ -984,7 +984,9 @@ class ApacheConfigurator(common.Configurator): for arg in args: arg_value = self.parser.get_arg(arg) if arg_value is not None: - addrs.add(obj.Addr.fromstring(arg_value)) + addr = obj.Addr.fromstring(arg_value) + if addr is not None: + addrs.add(addr) is_ssl = False if self.parser.find_dir("SSLEngine", "on", start=path, exclude=False): diff --git a/certbot/certbot/plugins/common.py b/certbot/certbot/plugins/common.py index b8aa023d1..3af0ee6ec 100644 --- a/certbot/certbot/plugins/common.py +++ b/certbot/certbot/plugins/common.py @@ -261,7 +261,7 @@ class Addr: self.ipv6 = ipv6 @classmethod - def fromstring(cls: Type[GenericAddr], str_addr: str) -> GenericAddr: + def fromstring(cls: Type[GenericAddr], str_addr: str) -> Optional[GenericAddr]: """Initialize Addr from string.""" if str_addr.startswith('['): # ipv6 addresses starts with [