From e5247ced5e08bd797ce79c5a07a9fbd0d0cfe54c Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Wed, 23 Dec 2015 18:32:20 -0500 Subject: [PATCH 01/15] Include the python version being used in the user agent for ACME requests. --- acme/acme/client.py | 5 ++++- letsencrypt/client.py | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/acme/acme/client.py b/acme/acme/client.py index c3e28ef47..cc90b7866 100644 --- a/acme/acme/client.py +++ b/acme/acme/client.py @@ -2,6 +2,7 @@ import datetime import heapq import logging +import platform import time import six @@ -483,6 +484,8 @@ class Client(object): # pylint: disable=too-many-instance-attributes 'Successful revocation must return HTTP OK status') +DEFAULT_USER_AGENT = 'acme-python Python/%s' % platform.python_version() + class ClientNetwork(object): """Client network.""" JSON_CONTENT_TYPE = 'application/json' @@ -490,7 +493,7 @@ class ClientNetwork(object): REPLAY_NONCE_HEADER = 'Replay-Nonce' def __init__(self, key, alg=jose.RS256, verify_ssl=True, - user_agent='acme-python'): + user_agent=DEFAULT_USER_AGENT): self.key = key self.alg = alg self.verify_ssl = verify_ssl diff --git a/letsencrypt/client.py b/letsencrypt/client.py index 080ee7991..b7c4ccab8 100644 --- a/letsencrypt/client.py +++ b/letsencrypt/client.py @@ -1,6 +1,7 @@ """Let's Encrypt client API.""" import logging import os +import platform from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import rsa @@ -51,9 +52,13 @@ def _determine_user_agent(config): """ if config.user_agent is None: - ua = "LetsEncryptPythonClient/{0} ({1}) Authenticator/{2} Installer/{3}" + ua = ( + "LetsEncryptPythonClient/{0} ({1}) Authenticator/{2} Installer/{3}" + " Python/{4}" + ) ua = ua.format(letsencrypt.__version__, " ".join(le_util.get_os_info()), - config.authenticator, config.installer) + config.authenticator, config.installer, + platform.python_version()) else: ua = config.user_agent return ua From 5376c3074599bbbcf5f44b8fe9127a2f62490d80 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 5 Jan 2016 07:30:49 -0500 Subject: [PATCH 02/15] Revert changes to the acme directory Only send the Python version in the user agent for the letsencrypt tool. --- acme/acme/client.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/acme/acme/client.py b/acme/acme/client.py index cc90b7866..c3e28ef47 100644 --- a/acme/acme/client.py +++ b/acme/acme/client.py @@ -2,7 +2,6 @@ import datetime import heapq import logging -import platform import time import six @@ -484,8 +483,6 @@ class Client(object): # pylint: disable=too-many-instance-attributes 'Successful revocation must return HTTP OK status') -DEFAULT_USER_AGENT = 'acme-python Python/%s' % platform.python_version() - class ClientNetwork(object): """Client network.""" JSON_CONTENT_TYPE = 'application/json' @@ -493,7 +490,7 @@ class ClientNetwork(object): REPLAY_NONCE_HEADER = 'Replay-Nonce' def __init__(self, key, alg=jose.RS256, verify_ssl=True, - user_agent=DEFAULT_USER_AGENT): + user_agent='acme-python'): self.key = key self.alg = alg self.verify_ssl = verify_ssl From 64a7608956f1cd19924d12312cba6f8f6bcbb94d Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 15 Mar 2017 17:19:00 -0700 Subject: [PATCH 03/15] Add auto-ness to the UA --- certbot/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/certbot/client.py b/certbot/client.py index 0f6b35f09..e1d578087 100644 --- a/certbot/client.py +++ b/certbot/client.py @@ -52,9 +52,10 @@ def determine_user_agent(config): """ if config.user_agent is None: - ua = "CertbotACMEClient/{0} ({1}) Authenticator/{2} Installer/{3}" + auto = "" if cli.cli_command == "certbot" else "auto" + ua = "CertbotACMEClient{4}/{0} ({1}) Authenticator/{2} Installer/{3}" ua = ua.format(certbot.__version__, util.get_os_info_ua(), - config.authenticator, config.installer) + config.authenticator, config.installer, auto) else: ua = config.user_agent return ua From 6fa521bc5f82f19f187c870cf633b1a43a6a6001 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 15 Mar 2017 18:02:03 -0700 Subject: [PATCH 04/15] Also report if we're renewing --- certbot/cli.py | 1 + certbot/client.py | 8 +++++--- certbot/main.py | 13 +++++++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/certbot/cli.py b/certbot/cli.py index b9172f21d..abcac6c94 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -526,6 +526,7 @@ class HelpfulArgumentParser(object): parsed_args = self.parser.parse_args(self.args) parsed_args.func = self.VERBS[self.verb] parsed_args.verb = self.verb + parsed_args.renewing = None # an important config property we don't know until later if self.detect_defaults: return parsed_args diff --git a/certbot/client.py b/certbot/client.py index 95de3ccb1..ab13da1f0 100644 --- a/certbot/client.py +++ b/certbot/client.py @@ -54,10 +54,11 @@ def determine_user_agent(config): if config.user_agent is None: auto = "no" if cli.cli_command == "certbot" else "yes" - ua = "CertbotACMEClient/{0} ({1}) Authenticator/{2} Installer/{3} Verb/{4} Auto/{5} Py/{6}" + ua = ("CertbotACMEClient/{0} ({1}) Authenticator/{2} Installer/{3} Verb/{4} " + "Renewing/{5} Auto/{6} Py/{7}") ua = ua.format(certbot.__version__, util.get_os_info_ua(), - config.authenticator, config.installer, config.verb, auto, - platform.python_version()) + config.authenticator, config.installer, config.verb, config.renewing, + auto, platform.python_version()) else: ua = config.user_agent return ua @@ -71,6 +72,7 @@ def sample_user_agent(): self.installer = "YYY" self.user_agent = None self.verb = "SUBCOMMAND" + self.renewing = "YESNOMAYBE" return determine_user_agent(DummyConfig()) diff --git a/certbot/main.py b/certbot/main.py index 1f247a7d6..43cc0b101 100644 --- a/certbot/main.py +++ b/certbot/main.py @@ -225,6 +225,10 @@ def _find_cert(config, domains, certname): RenewableCert instance or None. """ action, lineage = _find_lineage_for_domains_and_certname(config, domains, certname) + if action == "renew": + config.renewing = True + elif action == "newcert": + config.renewing = False if action == "reinstall": logger.info("Keeping the existing certificate") return (action != "reinstall"), lineage @@ -595,12 +599,12 @@ def run(config, plugins): # pylint: disable=too-many-branches,too-many-locals except errors.PluginSelectionError as e: return e.message - # TODO: Handle errors from _init_le_client? - le_client = _init_le_client(config, authenticator, installer) - domains, certname = _find_domains_or_certname(config, installer) should_get_cert, lineage = _find_cert(config, domains, certname) + # TODO: Handle errors from _init_le_client? + le_client = _init_le_client(config, authenticator, installer) + new_lineage = lineage if should_get_cert: new_lineage = _get_and_save_cert(le_client, config, domains, @@ -673,9 +677,9 @@ def certonly(config, plugins): except errors.PluginSelectionError as e: logger.info("Could not choose appropriate plugin: %s", e) raise - le_client = _init_le_client(config, auth, installer) if config.csr: + le_client = _init_le_client(config, auth, installer) cert_path, fullchain_path = _csr_get_and_save_cert(config, le_client) _report_new_cert(config, cert_path, fullchain_path) _suggest_donation_if_appropriate(config) @@ -683,6 +687,7 @@ def certonly(config, plugins): domains, certname = _find_domains_or_certname(config, installer) should_get_cert, lineage = _find_cert(config, domains, certname) + le_client = _init_le_client(config, auth, installer) # run after _find_cert for config.renewing if possible if not should_get_cert: notify = zope.component.getUtility(interfaces.IDisplay).notification From f259a1754944dda291083d3c2155ecb932cc6fb7 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Thu, 16 Mar 2017 01:14:06 -0700 Subject: [PATCH 05/15] Lint --- certbot/cli.py | 2 +- certbot/main.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/certbot/cli.py b/certbot/cli.py index abcac6c94..88b53796b 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -526,7 +526,7 @@ class HelpfulArgumentParser(object): parsed_args = self.parser.parse_args(self.args) parsed_args.func = self.VERBS[self.verb] parsed_args.verb = self.verb - parsed_args.renewing = None # an important config property we don't know until later + parsed_args.renewing = "unknown" # an important config property we don't know until later if self.detect_defaults: return parsed_args diff --git a/certbot/main.py b/certbot/main.py index 43cc0b101..d0dc0721a 100644 --- a/certbot/main.py +++ b/certbot/main.py @@ -687,7 +687,8 @@ def certonly(config, plugins): domains, certname = _find_domains_or_certname(config, installer) should_get_cert, lineage = _find_cert(config, domains, certname) - le_client = _init_le_client(config, auth, installer) # run after _find_cert for config.renewing if possible + # _init_le_client needs to run after _find_cert for config.renewing if possible + le_client = _init_le_client(config, auth, installer) if not should_get_cert: notify = zope.component.getUtility(interfaces.IDisplay).notification From 4846217445af161cd14ed76e3eb6ca8f521080ad Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Fri, 17 Mar 2017 15:20:24 -0700 Subject: [PATCH 06/15] Make config.renewing always a string. --- certbot/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/certbot/main.py b/certbot/main.py index d0dc0721a..bc61ef568 100644 --- a/certbot/main.py +++ b/certbot/main.py @@ -226,9 +226,9 @@ def _find_cert(config, domains, certname): """ action, lineage = _find_lineage_for_domains_and_certname(config, domains, certname) if action == "renew": - config.renewing = True + config.renewing = "Yes" elif action == "newcert": - config.renewing = False + config.renewing = "No" if action == "reinstall": logger.info("Keeping the existing certificate") return (action != "reinstall"), lineage From a313eebc7fca0b1985b270e7ebf365034e2a2b0f Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 5 Apr 2017 11:54:23 -0700 Subject: [PATCH 07/15] Conform to RFC 1945 --- certbot/client.py | 13 ++++++++----- certbot/main.py | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/certbot/client.py b/certbot/client.py index ab13da1f0..db5590e00 100644 --- a/certbot/client.py +++ b/certbot/client.py @@ -53,12 +53,15 @@ def determine_user_agent(config): """ if config.user_agent is None: - auto = "no" if cli.cli_command == "certbot" else "yes" - ua = ("CertbotACMEClient/{0} ({1}) Authenticator/{2} Installer/{3} Verb/{4} " - "Renewing/{5} Auto/{6} Py/{7}") - ua = ua.format(certbot.__version__, util.get_os_info_ua(), + if cli.cli_command in ["certbot", "letsencrypt", "certbot-auto", "letsencrypt-auto"]: + auto = cli.cli_command + else: + auto = "other" + ua = ("CertbotACMEClient/{0} ({1}; {2}) Authenticator/{3} Installer/{4} " + "({5}; renewing:{6}) Py/{7}") + ua = ua.format(certbot.__version__, auto, util.get_os_info_ua(), config.authenticator, config.installer, config.verb, config.renewing, - auto, platform.python_version()) + platform.python_version()) else: ua = config.user_agent return ua diff --git a/certbot/main.py b/certbot/main.py index bc61ef568..6b6ff06b2 100644 --- a/certbot/main.py +++ b/certbot/main.py @@ -226,9 +226,9 @@ def _find_cert(config, domains, certname): """ action, lineage = _find_lineage_for_domains_and_certname(config, domains, certname) if action == "renew": - config.renewing = "Yes" + config.renewing = "yes" elif action == "newcert": - config.renewing = "No" + config.renewing = "no" if action == "reinstall": logger.info("Keeping the existing certificate") return (action != "reinstall"), lineage From 2f0ec5c38804619139ca69a7d87fc89d42e50b15 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 5 Apr 2017 12:40:26 -0700 Subject: [PATCH 08/15] Set renewing: correctly for the "renew" case. --- certbot/main.py | 1 + certbot/renewal.py | 1 + 2 files changed, 2 insertions(+) diff --git a/certbot/main.py b/certbot/main.py index ee178aa50..448ed21d5 100644 --- a/certbot/main.py +++ b/certbot/main.py @@ -696,6 +696,7 @@ def certonly(config, plugins): def renew(config, unused_plugins): """Renew previously-obtained certificates.""" try: + config.renewing = "yes" renewal.handle_renewal_request(config) finally: hooks.run_saved_post_hooks() diff --git a/certbot/renewal.py b/certbot/renewal.py index 6eb171763..7b651a92a 100644 --- a/certbot/renewal.py +++ b/certbot/renewal.py @@ -393,6 +393,7 @@ def handle_renewal_request(config): # elements from within the renewal configuration file). try: renewal_candidate = _reconstitute(lineage_config, renewal_file) + renewal_candidate.renewing = "yes" except Exception as e: # pylint: disable=broad-except logger.warning("Renewal configuration file %s produced an " "unexpected error: %s. Skipping.", renewal_file, e) From 23a2ecb36e931fd62cfbde53c3e5d3f8cdb7d1ca Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 5 Apr 2017 15:28:14 -0700 Subject: [PATCH 09/15] Fixup --- certbot/renewal.py | 1 - 1 file changed, 1 deletion(-) diff --git a/certbot/renewal.py b/certbot/renewal.py index 7b651a92a..6eb171763 100644 --- a/certbot/renewal.py +++ b/certbot/renewal.py @@ -393,7 +393,6 @@ def handle_renewal_request(config): # elements from within the renewal configuration file). try: renewal_candidate = _reconstitute(lineage_config, renewal_file) - renewal_candidate.renewing = "yes" except Exception as e: # pylint: disable=broad-except logger.warning("Renewal configuration file %s produced an " "unexpected error: %s. Skipping.", renewal_file, e) From c35ca9775b8058b4b6acad11ffc1ca060fa07b03 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Thu, 6 Apr 2017 14:41:40 -0700 Subject: [PATCH 10/15] tweak comment --- certbot/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/certbot/cli.py b/certbot/cli.py index 0efec4352..14e3adf6d 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -532,7 +532,7 @@ class HelpfulArgumentParser(object): parsed_args = self.parser.parse_args(self.args) parsed_args.func = self.VERBS[self.verb] parsed_args.verb = self.verb - parsed_args.renewing = "unknown" # an important config property we don't know until later + parsed_args.renewing = "unknown" # used for the User Agent; not known until later if self.detect_defaults: return parsed_args From cb66ba95e1502741e8f97e21f53265093244c9b5 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Thu, 13 Apr 2017 20:00:31 -0700 Subject: [PATCH 11/15] Revert "Also report if we're renewing" This reverts commit 6fa521bc5f82f19f187c870cf633b1a43a6a6001. --- certbot/client.py | 5 ++--- certbot/main.py | 14 ++++---------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/certbot/client.py b/certbot/client.py index f42911921..1c0b71e20 100644 --- a/certbot/client.py +++ b/certbot/client.py @@ -59,9 +59,9 @@ def determine_user_agent(config): else: auto = "other" ua = ("CertbotACMEClient/{0} ({1}; {2}) Authenticator/{3} Installer/{4} " - "({5}; renewing:{6}) Py/{7}") + "({5}) Py/{7}") ua = ua.format(certbot.__version__, auto, util.get_os_info_ua(), - config.authenticator, config.installer, config.verb, config.renewing, + config.authenticator, config.installer, config.verb, platform.python_version()) else: ua = config.user_agent @@ -76,7 +76,6 @@ def sample_user_agent(): self.installer = "YYY" self.user_agent = None self.verb = "SUBCOMMAND" - self.renewing = "YESNOMAYBE" return determine_user_agent(DummyConfig()) diff --git a/certbot/main.py b/certbot/main.py index 448ed21d5..e9bf3b9ed 100644 --- a/certbot/main.py +++ b/certbot/main.py @@ -215,10 +215,6 @@ def _find_cert(config, domains, certname): RenewableCert instance or None. """ action, lineage = _find_lineage_for_domains_and_certname(config, domains, certname) - if action == "renew": - config.renewing = "yes" - elif action == "newcert": - config.renewing = "no" if action == "reinstall": logger.info("Keeping the existing certificate") return (action != "reinstall"), lineage @@ -590,12 +586,12 @@ def run(config, plugins): # pylint: disable=too-many-branches,too-many-locals except errors.PluginSelectionError as e: return e.message - domains, certname = _find_domains_or_certname(config, installer) - should_get_cert, lineage = _find_cert(config, domains, certname) - # TODO: Handle errors from _init_le_client? le_client = _init_le_client(config, authenticator, installer) + domains, certname = _find_domains_or_certname(config, installer) + should_get_cert, lineage = _find_cert(config, domains, certname) + new_lineage = lineage if should_get_cert: new_lineage = _get_and_save_cert(le_client, config, domains, @@ -668,9 +664,9 @@ def certonly(config, plugins): except errors.PluginSelectionError as e: logger.info("Could not choose appropriate plugin: %s", e) raise + le_client = _init_le_client(config, auth, installer) if config.csr: - le_client = _init_le_client(config, auth, installer) cert_path, fullchain_path = _csr_get_and_save_cert(config, le_client) _report_new_cert(config, cert_path, fullchain_path) _suggest_donation_if_appropriate(config) @@ -678,8 +674,6 @@ def certonly(config, plugins): domains, certname = _find_domains_or_certname(config, installer) should_get_cert, lineage = _find_cert(config, domains, certname) - # _init_le_client needs to run after _find_cert for config.renewing if possible - le_client = _init_le_client(config, auth, installer) if not should_get_cert: notify = zope.component.getUtility(interfaces.IDisplay).notification From 5be0811bdcf707624ab020036ef8834952f7ca20 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Thu, 13 Apr 2017 20:07:03 -0700 Subject: [PATCH 12/15] Replace removed "renewing" with potential future substitutes :/ --- certbot/client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/certbot/client.py b/certbot/client.py index 1c0b71e20..c450d19e7 100644 --- a/certbot/client.py +++ b/certbot/client.py @@ -58,10 +58,13 @@ def determine_user_agent(config): auto = cli.cli_command else: auto = "other" + flags = "dup" if config.duplicate else "" + flags += "force" if config.renew_by_default else "" + ua = ("CertbotACMEClient/{0} ({1}; {2}) Authenticator/{3} Installer/{4} " - "({5}) Py/{7}") + "({5}; flags: {6}) Py/{7}") ua = ua.format(certbot.__version__, auto, util.get_os_info_ua(), - config.authenticator, config.installer, config.verb, + config.authenticator, config.installer, config.verb, flags, platform.python_version()) else: ua = config.user_agent From 0a4ee306a9de6a74d49964921204699e51809d7f Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Fri, 28 Apr 2017 17:56:10 -0700 Subject: [PATCH 13/15] Fix UA flag setting (and set more of them) --- certbot/cli.py | 4 +++- certbot/client.py | 45 ++++++++++++++++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/certbot/cli.py b/certbot/cli.py index 14e3adf6d..82c9622f0 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -1108,7 +1108,9 @@ def _create_subparsers(helpful): "plugin and use case, and to know when to deprecate support for past Python " "versions. If you wish to hide this information from the Let's " 'Encrypt server, set this to "". ' - '(default: {0})'.format(sample_user_agent())) + '(default: {0}). The flags encoded in the user agent are: ' + '--duplicate, --force-renew, --allow-subset-of-names, -n, and ' + 'whether any hooks are set.'.format(sample_user_agent())) helpful.add("certonly", "--csr", type=read_file, help="Path to a Certificate Signing Request (CSR) in DER or PEM format." diff --git a/certbot/client.py b/certbot/client.py index c450d19e7..ad7323e62 100644 --- a/certbot/client.py +++ b/certbot/client.py @@ -58,27 +58,50 @@ def determine_user_agent(config): auto = cli.cli_command else: auto = "other" - flags = "dup" if config.duplicate else "" - flags += "force" if config.renew_by_default else "" ua = ("CertbotACMEClient/{0} ({1}; {2}) Authenticator/{3} Installer/{4} " "({5}; flags: {6}) Py/{7}") ua = ua.format(certbot.__version__, auto, util.get_os_info_ua(), - config.authenticator, config.installer, config.verb, flags, - platform.python_version()) + config.authenticator, config.installer, config.verb, + ua_flags(config), platform.python_version()) else: ua = config.user_agent return ua +def ua_flags(config): + "Turn some very important CLI flags into clues in the user agent." + if isinstance(config, DummyConfig): + return "FLAGS" + flags = [] + if config.duplicate: + flags.append("dup") + if config.renew_by_default: + flags.append("frn") + if config.allow_subset_of_names: + flags.append("asn") + if config.noninteractive_mode: + flags.append("n") + hook_names = ("pre", "post", "renew", "manual_auth", "manual_cleanup") + hooks = [getattr(config, h + "_hook") for h in hook_names] + if any(hooks): + flags.append("hook") + return " ".join(flags) + +class DummyConfig(object): + "Shim for computing a sample user agent." + def __init__(self): + self.authenticator = "XXX" + self.installer = "YYY" + self.user_agent = None + self.verb = "SUBCOMMAND" + + def __getattr__(self, name): + "Any config properties we might have are None." + return None + def sample_user_agent(): "Document what this Certbot's user agent string will be like." - class DummyConfig(object): - "Shim for computing a sample user agent." - def __init__(self): - self.authenticator = "XXX" - self.installer = "YYY" - self.user_agent = None - self.verb = "SUBCOMMAND" + return determine_user_agent(DummyConfig()) From f6c02728e4348a88fbca2acbacb2a8b55315b772 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Fri, 28 Apr 2017 18:37:58 -0700 Subject: [PATCH 14/15] Address review comments --- certbot/cli.py | 3 +-- certbot/client.py | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/certbot/cli.py b/certbot/cli.py index 82c9622f0..9e8778ceb 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -532,7 +532,6 @@ class HelpfulArgumentParser(object): parsed_args = self.parser.parse_args(self.args) parsed_args.func = self.VERBS[self.verb] parsed_args.verb = self.verb - parsed_args.renewing = "unknown" # used for the User Agent; not known until later if self.detect_defaults: return parsed_args @@ -1106,7 +1105,7 @@ def _create_subparsers(helpful): help="Set a custom user agent string for the client. User agent strings allow " "the CA to collect high level statistics about success rates by OS, " "plugin and use case, and to know when to deprecate support for past Python " - "versions. If you wish to hide this information from the Let's " + "versions and flags. If you wish to hide this information from the Let's " 'Encrypt server, set this to "". ' '(default: {0}). The flags encoded in the user agent are: ' '--duplicate, --force-renew, --allow-subset-of-names, -n, and ' diff --git a/certbot/client.py b/certbot/client.py index ad7323e62..dca6d8618 100644 --- a/certbot/client.py +++ b/certbot/client.py @@ -54,14 +54,9 @@ def determine_user_agent(config): """ if config.user_agent is None: - if cli.cli_command in ["certbot", "letsencrypt", "certbot-auto", "letsencrypt-auto"]: - auto = cli.cli_command - else: - auto = "other" - ua = ("CertbotACMEClient/{0} ({1}; {2}) Authenticator/{3} Installer/{4} " "({5}; flags: {6}) Py/{7}") - ua = ua.format(certbot.__version__, auto, util.get_os_info_ua(), + ua = ua.format(certbot.__version__, cli.cli_command, util.get_os_info_ua(), config.authenticator, config.installer, config.verb, ua_flags(config), platform.python_version()) else: From 72b6179e0eb2519b04d0c58dea1a1005d8ac5889 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Fri, 28 Apr 2017 18:45:42 -0700 Subject: [PATCH 15/15] Remove vestigial thingy --- certbot/main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/certbot/main.py b/certbot/main.py index e9bf3b9ed..256503d4e 100644 --- a/certbot/main.py +++ b/certbot/main.py @@ -690,7 +690,6 @@ def certonly(config, plugins): def renew(config, unused_plugins): """Renew previously-obtained certificates.""" try: - config.renewing = "yes" renewal.handle_renewal_request(config) finally: hooks.run_saved_post_hooks()