diff --git a/certbot-apache/certbot_apache/configurator.py b/certbot-apache/certbot_apache/configurator.py index 98657e144..c8a42c027 100644 --- a/certbot-apache/certbot_apache/configurator.py +++ b/certbot-apache/certbot_apache/configurator.py @@ -1384,10 +1384,10 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): msg_tmpl = ("Certbot was not able to find SSL VirtualHost for a " "domain {0} for enabling enhancement \"{1}\". The requested " "enhancement was not configured.") + msg_enhancement = enhancement if options: - msg = msg_tmpl.format(domain, options) - else: - msg = msg_tmpl.format(domain, enhancement) + msg_enhancement += ": " + options + msg = msg_tmpl.format(domain, msg_enhancement) logger.warning(msg) else: func(vhost, options) diff --git a/certbot/cli.py b/certbot/cli.py index 9f07d5ead..c5e79aab4 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -1118,7 +1118,7 @@ def prepare_and_parse_args(plugins, args, detect_defaults=False): # pylint: dis "security", "--no-uir", action="store_false", dest="uir", default=flag_default("uir"), help=argparse.SUPPRESS) helpful.add( - ["security", "enhance"], "--staple-ocsp", action="store_true", dest="staple", + "security", "--staple-ocsp", action="store_true", dest="staple", default=flag_default("staple"), help="Enables OCSP Stapling. A valid OCSP response is stapled to" " the certificate that the server offers during TLS.") diff --git a/certbot/main.py b/certbot/main.py index bb2946802..33beb5656 100644 --- a/certbot/main.py +++ b/certbot/main.py @@ -875,7 +875,7 @@ def enhance(config, plugins): :rtype: None """ - supported_enhancements = ["hsts", "redirect", "staple", "uir"] + supported_enhancements = ["hsts", "redirect", "uir"] # Check that at least one enhancement was requested on command line if not any([getattr(config, enh) for enh in supported_enhancements]): msg = ("Please specify one or more enhancement types to configure. To list " diff --git a/certbot/plugins/selection.py b/certbot/plugins/selection.py index ddbde063c..5d286bbf4 100644 --- a/certbot/plugins/selection.py +++ b/certbot/plugins/selection.py @@ -161,8 +161,12 @@ def choose_configurator_plugins(config, plugins, verb): req_auth, req_inst = cli_plugin_requests(config) - installer_question = ("How would you like to authenticate and install " - "certificates?") + if verb == "enhance": + installer_question = ("Which plugin would you like to use for adding " + "security enhancements to your configuration?") + else: + installer_question = ("How would you like to authenticate and install " + "certificates?") # Which plugins do we need? if verb == "run": diff --git a/certbot/tests/main_test.py b/certbot/tests/main_test.py index 547d4ec7f..c654ebd7e 100644 --- a/certbot/tests/main_test.py +++ b/certbot/tests/main_test.py @@ -1588,7 +1588,7 @@ class EnhanceTest(unittest.TestCase): '-d', 'another.tld', '--redirect', '--hsts']) req_enh = ["redirect", "hsts"] - not_req_enh = ["staple", "uir"] + not_req_enh = ["uir"] self.assertTrue(mock_client.enhance_config.called) self.assertTrue( all([getattr(mock_client.config, e) for e in req_enh]))