diff --git a/letsencrypt-apache/letsencrypt_apache/configurator.py b/letsencrypt-apache/letsencrypt_apache/configurator.py index 6ef1fbee2..4b66c5c6f 100644 --- a/letsencrypt-apache/letsencrypt_apache/configurator.py +++ b/letsencrypt-apache/letsencrypt_apache/configurator.py @@ -122,7 +122,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): self.version = version self.vhosts = None self._enhance_func = {"redirect": self._enable_redirect, - "http-header": self._set_http_header} + "ensure-http-header": self._set_http_header} @property def mod_ssl_conf(self): @@ -701,7 +701,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): ############################################################################ def supported_enhancements(self): # pylint: disable=no-self-use """Returns currently supported enhancements.""" - return ["redirect", "http-header"] + return ["redirect", "ensure-http-header"] def enhance(self, domain, enhancement, options=None): """Enhance configuration. diff --git a/letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py b/letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py index 36a3f13fa..8eb1e16e2 100644 --- a/letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py +++ b/letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py @@ -521,7 +521,7 @@ class TwoVhost80Test(util.ApacheTest): mock_exe.return_value = True # This will create an ssl vhost for letsencrypt.demo - self.config.enhance("letsencrypt.demo", "http-header", + self.config.enhance("letsencrypt.demo", "ensure-http-header", "Strict-Transport-Security") self.assertTrue("headers_module" in self.config.parser.modules) @@ -543,12 +543,12 @@ class TwoVhost80Test(util.ApacheTest): self.config.parser.modules.add("headers_module") # This will create an ssl vhost for letsencrypt.demo - self.config.enhance("encryption-example.demo", "http-header", + self.config.enhance("encryption-example.demo", "ensure-http-header", "Strict-Transport-Security") self.assertRaises( errors.PluginError, - self.config.enhance, "encryption-example.demo", "http-header", + self.config.enhance, "encryption-example.demo", "ensure-http-header", "Strict-Transport-Security") @mock.patch("letsencrypt.le_util.run_script") @@ -559,7 +559,7 @@ class TwoVhost80Test(util.ApacheTest): mock_exe.return_value = True # This will create an ssl vhost for letsencrypt.demo - self.config.enhance("letsencrypt.demo", "http-header", + self.config.enhance("letsencrypt.demo", "ensure-http-header", "Upgrade-Insecure-Requests") self.assertTrue("headers_module" in self.config.parser.modules) @@ -581,12 +581,12 @@ class TwoVhost80Test(util.ApacheTest): self.config.parser.modules.add("headers_module") # This will create an ssl vhost for letsencrypt.demo - self.config.enhance("encryption-example.demo", "http-header", + self.config.enhance("encryption-example.demo", "ensure-http-header", "Upgrade-Insecure-Requests") self.assertRaises( errors.PluginError, - self.config.enhance, "encryption-example.demo", "http-header", + self.config.enhance, "encryption-example.demo", "ensure-http-header", "Upgrade-Insecure-Requests") diff --git a/letsencrypt/client.py b/letsencrypt/client.py index e1b0c4b84..3eaf9eaef 100644 --- a/letsencrypt/client.py +++ b/letsencrypt/client.py @@ -418,10 +418,10 @@ class Client(object): self.apply_enhancement(domains, "redirect") if hsts: - self.apply_enhancement(domains, "http-header", + self.apply_enhancement(domains, "ensure-http-header", "Strict-Transport-Security") if uir: - self.apply_enhancement(domains, "http-header", + self.apply_enhancement(domains, "ensure-http-header", "Upgrade-Insecure-Requests") msg = ("We were unable to restart web server") @@ -435,7 +435,7 @@ class Client(object): :param domains: list of ssl_vhosts :type list of str - :param enhancement: name of enhancement, e.g. http-header + :param enhancement: name of enhancement, e.g. ensure-http-header :type str .. note:: when more options are need make options a list. diff --git a/letsencrypt/tests/client_test.py b/letsencrypt/tests/client_test.py index 340e88abe..578cd77ab 100644 --- a/letsencrypt/tests/client_test.py +++ b/letsencrypt/tests/client_test.py @@ -262,12 +262,12 @@ class ClientTest(unittest.TestCase): config = ConfigHelper(redirect=False, hsts=True, uir=False) self.client.enhance_config(["foo.bar"], config) - installer.enhance.assert_called_with("foo.bar", "http-header", + installer.enhance.assert_called_with("foo.bar", "ensure-http-header", "Strict-Transport-Security") config = ConfigHelper(redirect=False, hsts=False, uir=True) self.client.enhance_config(["foo.bar"], config) - installer.enhance.assert_called_with("foo.bar", "http-header", + installer.enhance.assert_called_with("foo.bar", "ensure-http-header", "Upgrade-Insecure-Requests") self.assertEqual(installer.save.call_count, 3)