diff --git a/letsencrypt-apache/letsencrypt_apache/configurator.py b/letsencrypt-apache/letsencrypt_apache/configurator.py index f10f0c241..64449302a 100644 --- a/letsencrypt-apache/letsencrypt_apache/configurator.py +++ b/letsencrypt-apache/letsencrypt_apache/configurator.py @@ -234,7 +234,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): if not vhost.enabled: self.enable_site(vhost) - def choose_vhost(self, target_name): + def choose_vhost(self, target_name, dvsni=False): """Chooses a virtual host based on the given domain name. If there is no clear virtual host to be selected, the user is prompted @@ -255,6 +255,8 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): # Try to find a reasonable vhost vhost = self._find_best_vhost(target_name) if vhost is not None: + if dvsni: + return vhost if not vhost.ssl: vhost = self.make_vhost_ssl(vhost) diff --git a/letsencrypt-apache/letsencrypt_apache/dvsni.py b/letsencrypt-apache/letsencrypt_apache/dvsni.py index 2f9e9ed18..0dd411e4f 100644 --- a/letsencrypt-apache/letsencrypt_apache/dvsni.py +++ b/letsencrypt-apache/letsencrypt_apache/dvsni.py @@ -110,7 +110,7 @@ class ApacheDvsni(common.TLSSNI01): def get_dvsni_addrs(self, achall): """Return the Apache addresses needed for DVSNI.""" - vhost = self.configurator.choose_vhost(achall.domain) + vhost = self.configurator.choose_vhost(achall.domain, dvsni=True) # TODO: Checkout _default_ rules. dvsni_addrs = set()