diff --git a/certbot/cli.py b/certbot/cli.py index c0af490d2..b9172f21d 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -1082,8 +1082,9 @@ def _create_subparsers(helpful): helpful.add( None, "--user-agent", default=None, 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 and " - "plugin. If you wish to hide your server OS version from the Let's " + "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 " 'Encrypt server, set this to "". ' '(default: {0})'.format(sample_user_agent())) helpful.add("certonly", diff --git a/certbot/client.py b/certbot/client.py index e1d578087..95de3ccb1 100644 --- a/certbot/client.py +++ b/certbot/client.py @@ -1,6 +1,7 @@ """Certbot client API.""" import logging import os +import platform from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import rsa @@ -52,10 +53,11 @@ def determine_user_agent(config): """ if config.user_agent is None: - auto = "" if cli.cli_command == "certbot" else "auto" - ua = "CertbotACMEClient{4}/{0} ({1}) Authenticator/{2} Installer/{3}" + auto = "no" if cli.cli_command == "certbot" else "yes" + ua = "CertbotACMEClient/{0} ({1}) Authenticator/{2} Installer/{3} Verb/{4} Auto/{5} Py/{6}" ua = ua.format(certbot.__version__, util.get_os_info_ua(), - config.authenticator, config.installer, auto) + config.authenticator, config.installer, config.verb, auto, + platform.python_version()) else: ua = config.user_agent return ua @@ -68,6 +70,7 @@ def sample_user_agent(): self.authenticator = "XXX" self.installer = "YYY" self.user_agent = None + self.verb = "SUBCOMMAND" return determine_user_agent(DummyConfig())