From 9bf1b99b5bfcb5d7ab743b8b49068ba5bd8a463b Mon Sep 17 00:00:00 2001 From: Liam Marshall Date: Fri, 13 Nov 2015 17:16:50 -0600 Subject: [PATCH] Remove existing SSL directives for SSL vhosts --- letsencrypt-apache/letsencrypt_apache/configurator.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/letsencrypt-apache/letsencrypt_apache/configurator.py b/letsencrypt-apache/letsencrypt_apache/configurator.py index c52f3fc70..ccb0ebc62 100644 --- a/letsencrypt-apache/letsencrypt_apache/configurator.py +++ b/letsencrypt-apache/letsencrypt_apache/configurator.py @@ -265,6 +265,12 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): # Try to find a reasonable vhost vhost = self._find_best_vhost(target_name) if vhost is not None: + if vhost.ssl: + # remove existing SSL directives (minus the ones we'll use anyway, + # since we want to preserve order) + self._remove_existing_ssl_directives( + vhost, + minus=['SSLCertificatePath', 'SSLCertificateKeyFile']) if not vhost.ssl: vhost = self.make_vhost_ssl(vhost)