We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix Nginx prompt
Saw the following prompt when using Nginx

```
-------------------------------------------------------------------------------
No names were found in your configuration files.
You should specify ServerNames in your config files in order to allow for
accurate installation of your certificate.
If you do use the default vhost, you may specify the name manually. Would you
like to continue?
-------------------------------------------------------------------------------
(Y)es/(N)o: 
```

`ServerName` is Apache specific and based on #3508, we don't want to allow people to use the default vhost.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `certbot/display/ops.py`
Content:
```
1 """Contains UI methods for LE user operations."""
2 import logging
3 import os
4 
5 import zope.component
6 
7 from certbot import errors
8 from certbot import interfaces
9 from certbot import util
10 from certbot.display import util as display_util
11 
12 logger = logging.getLogger(__name__)
13 
14 # Define a helper function to avoid verbose code
15 z_util = zope.component.getUtility
16 
17 
18 def get_email(invalid=False, optional=True):
19     """Prompt for valid email address.
20 
21     :param bool invalid: True if an invalid address was provided by the user
22     :param bool optional: True if the user can use
23         --register-unsafely-without-email to avoid providing an e-mail
24 
25     :returns: e-mail address
26     :rtype: str
27 
28     :raises errors.Error: if the user cancels
29 
30     """
31     invalid_prefix = "There seem to be problems with that address. "
32     msg = "Enter email address (used for urgent notices and lost key recovery)"
33     unsafe_suggestion = ("\n\nIf you really want to skip this, you can run "
34                          "the client with --register-unsafely-without-email "
35                          "but make sure you then backup your account key from "
36                          "/etc/letsencrypt/accounts\n\n")
37     if optional:
38         if invalid:
39             msg += unsafe_suggestion
40         else:
41             suggest_unsafe = True
42     else:
43         suggest_unsafe = False
44 
45     while True:
46         try:
47             code, email = z_util(interfaces.IDisplay).input(
48                 invalid_prefix + msg if invalid else msg)
49         except errors.MissingCommandlineFlag:
50             msg = ("You should register before running non-interactively, "
51                    "or provide --agree-tos and --email <email_address> flags.")
52             raise errors.MissingCommandlineFlag(msg)
53 
54         if code != display_util.OK:
55             if optional:
56                 raise errors.Error(
57                     "An e-mail address or "
58                     "--register-unsafely-without-email must be provided.")
59             else:
60                 raise errors.Error("An e-mail address must be provided.")
61         elif util.safe_email(email):
62             return email
63         elif suggest_unsafe:
64             msg += unsafe_suggestion
65             suggest_unsafe = False  # add this message at most once
66 
67         invalid = bool(email)
68 
69 
70 def choose_account(accounts):
71     """Choose an account.
72 
73     :param list accounts: Containing at least one
74         :class:`~certbot.account.Account`
75 
76     """
77     # Note this will get more complicated once we start recording authorizations
78     labels = [acc.slug for acc in accounts]
79 
80     code, index = z_util(interfaces.IDisplay).menu(
81         "Please choose an account", labels)
82     if code == display_util.OK:
83         return accounts[index]
84     else:
85         return None
86 
87 
88 def choose_names(installer):
89     """Display screen to select domains to validate.
90 
91     :param installer: An installer object
92     :type installer: :class:`certbot.interfaces.IInstaller`
93 
94     :returns: List of selected names
95     :rtype: `list` of `str`
96 
97     """
98     if installer is None:
99         logger.debug("No installer, picking names manually")
100         return _choose_names_manually()
101 
102     domains = list(installer.get_all_names())
103     names = get_valid_domains(domains)
104 
105     if not names:
106         manual = z_util(interfaces.IDisplay).yesno(
107             "No names were found in your configuration files.{0}You should "
108             "specify ServerNames in your config files in order to allow for "
109             "accurate installation of your certificate.{0}"
110             "If you do use the default vhost, you may specify the name "
111             "manually. Would you like to continue?{0}".format(os.linesep),
112             default=True)
113 
114         if manual:
115             return _choose_names_manually()
116         else:
117             return []
118 
119     code, names = _filter_names(names)
120     if code == display_util.OK and names:
121         return names
122     else:
123         return []
124 
125 
126 def get_valid_domains(domains):
127     """Helper method for choose_names that implements basic checks
128      on domain names
129 
130     :param list domains: Domain names to validate
131     :return: List of valid domains
132     :rtype: list
133     """
134     valid_domains = []
135     for domain in domains:
136         try:
137             valid_domains.append(util.enforce_domain_sanity(domain))
138         except errors.ConfigurationError:
139             continue
140     return valid_domains
141 
142 
143 def _filter_names(names):
144     """Determine which names the user would like to select from a list.
145 
146     :param list names: domain names
147 
148     :returns: tuple of the form (`code`, `names`) where
149         `code` - str display exit code
150         `names` - list of names selected
151     :rtype: tuple
152 
153     """
154     code, names = z_util(interfaces.IDisplay).checklist(
155         "Which names would you like to activate HTTPS for?",
156         tags=names, cli_flag="--domains")
157     return code, [str(s) for s in names]
158 
159 
160 def _choose_names_manually():
161     """Manually input names for those without an installer."""
162 
163     code, input_ = z_util(interfaces.IDisplay).input(
164         "Please enter in your domain name(s) (comma and/or space separated) ",
165         cli_flag="--domains")
166 
167     if code == display_util.OK:
168         invalid_domains = dict()
169         retry_message = ""
170         try:
171             domain_list = display_util.separate_list_input(input_)
172         except UnicodeEncodeError:
173             domain_list = []
174             retry_message = (
175                 "Internationalized domain names are not presently "
176                 "supported.{0}{0}Would you like to re-enter the "
177                 "names?{0}").format(os.linesep)
178 
179         for i, domain in enumerate(domain_list):
180             try:
181                 domain_list[i] = util.enforce_domain_sanity(domain)
182             except errors.ConfigurationError as e:
183                 try:  # Python 2
184                     # pylint: disable=no-member
185                     err_msg = e.message.encode('utf-8')
186                 except AttributeError:
187                     err_msg = str(e)
188                 invalid_domains[domain] = err_msg
189 
190         if len(invalid_domains):
191             retry_message = (
192                 "One or more of the entered domain names was not valid:"
193                 "{0}{0}").format(os.linesep)
194             for domain in invalid_domains:
195                 retry_message = retry_message + "{1}: {2}{0}".format(
196                     os.linesep, domain, invalid_domains[domain])
197             retry_message = retry_message + (
198                 "{0}Would you like to re-enter the names?{0}").format(
199                     os.linesep)
200 
201         if retry_message:
202             # We had error in input
203             retry = z_util(interfaces.IDisplay).yesno(retry_message)
204             if retry:
205                 return _choose_names_manually()
206         else:
207             return domain_list
208     return []
209 
210 
211 def success_installation(domains):
212     """Display a box confirming the installation of HTTPS.
213 
214     .. todo:: This should be centered on the screen
215 
216     :param list domains: domain names which were enabled
217 
218     """
219     z_util(interfaces.IDisplay).notification(
220         "Congratulations! You have successfully enabled {0}{1}{1}"
221         "You should test your configuration at:{1}{2}".format(
222             _gen_https_names(domains),
223             os.linesep,
224             os.linesep.join(_gen_ssl_lab_urls(domains))),
225         height=(10 + len(domains)),
226         pause=False)
227 
228 
229 def success_renewal(domains, action):
230     """Display a box confirming the renewal of an existing certificate.
231 
232     .. todo:: This should be centered on the screen
233 
234     :param list domains: domain names which were renewed
235     :param str action: can be "reinstall" or "renew"
236 
237     """
238     z_util(interfaces.IDisplay).notification(
239         "Your existing certificate has been successfully {3}ed, and the "
240         "new certificate has been installed.{1}{1}"
241         "The new certificate covers the following domains: {0}{1}{1}"
242         "You should test your configuration at:{1}{2}".format(
243             _gen_https_names(domains),
244             os.linesep,
245             os.linesep.join(_gen_ssl_lab_urls(domains)),
246             action),
247         height=(14 + len(domains)),
248         pause=False)
249 
250 
251 def _gen_ssl_lab_urls(domains):
252     """Returns a list of urls.
253 
254     :param list domains: Each domain is a 'str'
255 
256     """
257     return ["https://www.ssllabs.com/ssltest/analyze.html?d=%s" % dom for dom in domains]
258 
259 
260 def _gen_https_names(domains):
261     """Returns a string of the https domains.
262 
263     Domains are formatted nicely with https:// prepended to each.
264 
265     :param list domains: Each domain is a 'str'
266 
267     """
268     if len(domains) == 1:
269         return "https://{0}".format(domains[0])
270     elif len(domains) == 2:
271         return "https://{dom[0]} and https://{dom[1]}".format(dom=domains)
272     elif len(domains) > 2:
273         return "{0}{1}{2}".format(
274             ", ".join("https://%s" % dom for dom in domains[:-1]),
275             ", and https://",
276             domains[-1])
277 
278     return ""
279
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/certbot/display/ops.py b/certbot/display/ops.py
--- a/certbot/display/ops.py
+++ b/certbot/display/ops.py
@@ -103,18 +103,8 @@
     names = get_valid_domains(domains)
 
     if not names:
-        manual = z_util(interfaces.IDisplay).yesno(
-            "No names were found in your configuration files.{0}You should "
-            "specify ServerNames in your config files in order to allow for "
-            "accurate installation of your certificate.{0}"
-            "If you do use the default vhost, you may specify the name "
-            "manually. Would you like to continue?{0}".format(os.linesep),
-            default=True)
-
-        if manual:
-            return _choose_names_manually()
-        else:
-            return []
+        return _choose_names_manually(
+            "No names were found in your configuration files. ")
 
     code, names = _filter_names(names)
     if code == display_util.OK and names:
@@ -157,10 +147,17 @@
     return code, [str(s) for s in names]
 
 
-def _choose_names_manually():
-    """Manually input names for those without an installer."""
+def _choose_names_manually(prompt_prefix=""):
+    """Manually input names for those without an installer.
+
+    :param str prompt_prefix: string to prepend to prompt for domains
 
+    :returns: list of provided names
+    :rtype: `list` of `str`
+
+    """
     code, input_ = z_util(interfaces.IDisplay).input(
+        prompt_prefix +
         "Please enter in your domain name(s) (comma and/or space separated) ",
         cli_flag="--domains")

{"golden_diff": "diff --git a/certbot/display/ops.py b/certbot/display/ops.py\n--- a/certbot/display/ops.py\n+++ b/certbot/display/ops.py\n@@ -103,18 +103,8 @@\n     names = get_valid_domains(domains)\n \n     if not names:\n-        manual = z_util(interfaces.IDisplay).yesno(\n-            \"No names were found in your configuration files.{0}You should \"\n-            \"specify ServerNames in your config files in order to allow for \"\n-            \"accurate installation of your certificate.{0}\"\n-            \"If you do use the default vhost, you may specify the name \"\n-            \"manually. Would you like to continue?{0}\".format(os.linesep),\n-            default=True)\n-\n-        if manual:\n-            return _choose_names_manually()\n-        else:\n-            return []\n+        return _choose_names_manually(\n+            \"No names were found in your configuration files. \")\n \n     code, names = _filter_names(names)\n     if code == display_util.OK and names:\n@@ -157,10 +147,17 @@\n     return code, [str(s) for s in names]\n \n \n-def _choose_names_manually():\n-    \"\"\"Manually input names for those without an installer.\"\"\"\n+def _choose_names_manually(prompt_prefix=\"\"):\n+    \"\"\"Manually input names for those without an installer.\n+\n+    :param str prompt_prefix: string to prepend to prompt for domains\n \n+    :returns: list of provided names\n+    :rtype: `list` of `str`\n+\n+    \"\"\"\n     code, input_ = z_util(interfaces.IDisplay).input(\n+        prompt_prefix +\n         \"Please enter in your domain name(s) (comma and/or space separated) \",\n         cli_flag=\"--domains\")\n", "issue": "Fix Nginx prompt\nSaw the following prompt when using Nginx\n\n```\n-------------------------------------------------------------------------------\nNo names were found in your configuration files.\nYou should specify ServerNames in your config files in order to allow for\naccurate installation of your certificate.\nIf you do use the default vhost, you may specify the name manually. Would you\nlike to continue?\n-------------------------------------------------------------------------------\n(Y)es/(N)o: \n```\n\n`ServerName` is Apache specific and based on #3508, we don't want to allow people to use the default vhost.\n\n", "before_files": [{"content": "\"\"\"Contains UI methods for LE user operations.\"\"\"\nimport logging\nimport os\n\nimport zope.component\n\nfrom certbot import errors\nfrom certbot import interfaces\nfrom certbot import util\nfrom certbot.display import util as display_util\n\nlogger = logging.getLogger(__name__)\n\n# Define a helper function to avoid verbose code\nz_util = zope.component.getUtility\n\n\ndef get_email(invalid=False, optional=True):\n    \"\"\"Prompt for valid email address.\n\n    :param bool invalid: True if an invalid address was provided by the user\n    :param bool optional: True if the user can use\n        --register-unsafely-without-email to avoid providing an e-mail\n\n    :returns: e-mail address\n    :rtype: str\n\n    :raises errors.Error: if the user cancels\n\n    \"\"\"\n    invalid_prefix = \"There seem to be problems with that address. \"\n    msg = \"Enter email address (used for urgent notices and lost key recovery)\"\n    unsafe_suggestion = (\"\\n\\nIf you really want to skip this, you can run \"\n                         \"the client with --register-unsafely-without-email \"\n                         \"but make sure you then backup your account key from \"\n                         \"/etc/letsencrypt/accounts\\n\\n\")\n    if optional:\n        if invalid:\n            msg += unsafe_suggestion\n        else:\n            suggest_unsafe = True\n    else:\n        suggest_unsafe = False\n\n    while True:\n        try:\n            code, email = z_util(interfaces.IDisplay).input(\n                invalid_prefix + msg if invalid else msg)\n        except errors.MissingCommandlineFlag:\n            msg = (\"You should register before running non-interactively, \"\n                   \"or provide --agree-tos and --email <email_address> flags.\")\n            raise errors.MissingCommandlineFlag(msg)\n\n        if code != display_util.OK:\n            if optional:\n                raise errors.Error(\n                    \"An e-mail address or \"\n                    \"--register-unsafely-without-email must be provided.\")\n            else:\n                raise errors.Error(\"An e-mail address must be provided.\")\n        elif util.safe_email(email):\n            return email\n        elif suggest_unsafe:\n            msg += unsafe_suggestion\n            suggest_unsafe = False  # add this message at most once\n\n        invalid = bool(email)\n\n\ndef choose_account(accounts):\n    \"\"\"Choose an account.\n\n    :param list accounts: Containing at least one\n        :class:`~certbot.account.Account`\n\n    \"\"\"\n    # Note this will get more complicated once we start recording authorizations\n    labels = [acc.slug for acc in accounts]\n\n    code, index = z_util(interfaces.IDisplay).menu(\n        \"Please choose an account\", labels)\n    if code == display_util.OK:\n        return accounts[index]\n    else:\n        return None\n\n\ndef choose_names(installer):\n    \"\"\"Display screen to select domains to validate.\n\n    :param installer: An installer object\n    :type installer: :class:`certbot.interfaces.IInstaller`\n\n    :returns: List of selected names\n    :rtype: `list` of `str`\n\n    \"\"\"\n    if installer is None:\n        logger.debug(\"No installer, picking names manually\")\n        return _choose_names_manually()\n\n    domains = list(installer.get_all_names())\n    names = get_valid_domains(domains)\n\n    if not names:\n        manual = z_util(interfaces.IDisplay).yesno(\n            \"No names were found in your configuration files.{0}You should \"\n            \"specify ServerNames in your config files in order to allow for \"\n            \"accurate installation of your certificate.{0}\"\n            \"If you do use the default vhost, you may specify the name \"\n            \"manually. Would you like to continue?{0}\".format(os.linesep),\n            default=True)\n\n        if manual:\n            return _choose_names_manually()\n        else:\n            return []\n\n    code, names = _filter_names(names)\n    if code == display_util.OK and names:\n        return names\n    else:\n        return []\n\n\ndef get_valid_domains(domains):\n    \"\"\"Helper method for choose_names that implements basic checks\n     on domain names\n\n    :param list domains: Domain names to validate\n    :return: List of valid domains\n    :rtype: list\n    \"\"\"\n    valid_domains = []\n    for domain in domains:\n        try:\n            valid_domains.append(util.enforce_domain_sanity(domain))\n        except errors.ConfigurationError:\n            continue\n    return valid_domains\n\n\ndef _filter_names(names):\n    \"\"\"Determine which names the user would like to select from a list.\n\n    :param list names: domain names\n\n    :returns: tuple of the form (`code`, `names`) where\n        `code` - str display exit code\n        `names` - list of names selected\n    :rtype: tuple\n\n    \"\"\"\n    code, names = z_util(interfaces.IDisplay).checklist(\n        \"Which names would you like to activate HTTPS for?\",\n        tags=names, cli_flag=\"--domains\")\n    return code, [str(s) for s in names]\n\n\ndef _choose_names_manually():\n    \"\"\"Manually input names for those without an installer.\"\"\"\n\n    code, input_ = z_util(interfaces.IDisplay).input(\n        \"Please enter in your domain name(s) (comma and/or space separated) \",\n        cli_flag=\"--domains\")\n\n    if code == display_util.OK:\n        invalid_domains = dict()\n        retry_message = \"\"\n        try:\n            domain_list = display_util.separate_list_input(input_)\n        except UnicodeEncodeError:\n            domain_list = []\n            retry_message = (\n                \"Internationalized domain names are not presently \"\n                \"supported.{0}{0}Would you like to re-enter the \"\n                \"names?{0}\").format(os.linesep)\n\n        for i, domain in enumerate(domain_list):\n            try:\n                domain_list[i] = util.enforce_domain_sanity(domain)\n            except errors.ConfigurationError as e:\n                try:  # Python 2\n                    # pylint: disable=no-member\n                    err_msg = e.message.encode('utf-8')\n                except AttributeError:\n                    err_msg = str(e)\n                invalid_domains[domain] = err_msg\n\n        if len(invalid_domains):\n            retry_message = (\n                \"One or more of the entered domain names was not valid:\"\n                \"{0}{0}\").format(os.linesep)\n            for domain in invalid_domains:\n                retry_message = retry_message + \"{1}: {2}{0}\".format(\n                    os.linesep, domain, invalid_domains[domain])\n            retry_message = retry_message + (\n                \"{0}Would you like to re-enter the names?{0}\").format(\n                    os.linesep)\n\n        if retry_message:\n            # We had error in input\n            retry = z_util(interfaces.IDisplay).yesno(retry_message)\n            if retry:\n                return _choose_names_manually()\n        else:\n            return domain_list\n    return []\n\n\ndef success_installation(domains):\n    \"\"\"Display a box confirming the installation of HTTPS.\n\n    .. todo:: This should be centered on the screen\n\n    :param list domains: domain names which were enabled\n\n    \"\"\"\n    z_util(interfaces.IDisplay).notification(\n        \"Congratulations! You have successfully enabled {0}{1}{1}\"\n        \"You should test your configuration at:{1}{2}\".format(\n            _gen_https_names(domains),\n            os.linesep,\n            os.linesep.join(_gen_ssl_lab_urls(domains))),\n        height=(10 + len(domains)),\n        pause=False)\n\n\ndef success_renewal(domains, action):\n    \"\"\"Display a box confirming the renewal of an existing certificate.\n\n    .. todo:: This should be centered on the screen\n\n    :param list domains: domain names which were renewed\n    :param str action: can be \"reinstall\" or \"renew\"\n\n    \"\"\"\n    z_util(interfaces.IDisplay).notification(\n        \"Your existing certificate has been successfully {3}ed, and the \"\n        \"new certificate has been installed.{1}{1}\"\n        \"The new certificate covers the following domains: {0}{1}{1}\"\n        \"You should test your configuration at:{1}{2}\".format(\n            _gen_https_names(domains),\n            os.linesep,\n            os.linesep.join(_gen_ssl_lab_urls(domains)),\n            action),\n        height=(14 + len(domains)),\n        pause=False)\n\n\ndef _gen_ssl_lab_urls(domains):\n    \"\"\"Returns a list of urls.\n\n    :param list domains: Each domain is a 'str'\n\n    \"\"\"\n    return [\"https://www.ssllabs.com/ssltest/analyze.html?d=%s\" % dom for dom in domains]\n\n\ndef _gen_https_names(domains):\n    \"\"\"Returns a string of the https domains.\n\n    Domains are formatted nicely with https:// prepended to each.\n\n    :param list domains: Each domain is a 'str'\n\n    \"\"\"\n    if len(domains) == 1:\n        return \"https://{0}\".format(domains[0])\n    elif len(domains) == 2:\n        return \"https://{dom[0]} and https://{dom[1]}\".format(dom=domains)\n    elif len(domains) > 2:\n        return \"{0}{1}{2}\".format(\n            \", \".join(\"https://%s\" % dom for dom in domains[:-1]),\n            \", and https://\",\n            domains[-1])\n\n    return \"\"\n", "path": "certbot/display/ops.py"}], "after_files": [{"content": "\"\"\"Contains UI methods for LE user operations.\"\"\"\nimport logging\nimport os\n\nimport zope.component\n\nfrom certbot import errors\nfrom certbot import interfaces\nfrom certbot import util\nfrom certbot.display import util as display_util\n\nlogger = logging.getLogger(__name__)\n\n# Define a helper function to avoid verbose code\nz_util = zope.component.getUtility\n\n\ndef get_email(invalid=False, optional=True):\n    \"\"\"Prompt for valid email address.\n\n    :param bool invalid: True if an invalid address was provided by the user\n    :param bool optional: True if the user can use\n        --register-unsafely-without-email to avoid providing an e-mail\n\n    :returns: e-mail address\n    :rtype: str\n\n    :raises errors.Error: if the user cancels\n\n    \"\"\"\n    invalid_prefix = \"There seem to be problems with that address. \"\n    msg = \"Enter email address (used for urgent notices and lost key recovery)\"\n    unsafe_suggestion = (\"\\n\\nIf you really want to skip this, you can run \"\n                         \"the client with --register-unsafely-without-email \"\n                         \"but make sure you then backup your account key from \"\n                         \"/etc/letsencrypt/accounts\\n\\n\")\n    if optional:\n        if invalid:\n            msg += unsafe_suggestion\n        else:\n            suggest_unsafe = True\n    else:\n        suggest_unsafe = False\n\n    while True:\n        try:\n            code, email = z_util(interfaces.IDisplay).input(\n                invalid_prefix + msg if invalid else msg)\n        except errors.MissingCommandlineFlag:\n            msg = (\"You should register before running non-interactively, \"\n                   \"or provide --agree-tos and --email <email_address> flags.\")\n            raise errors.MissingCommandlineFlag(msg)\n\n        if code != display_util.OK:\n            if optional:\n                raise errors.Error(\n                    \"An e-mail address or \"\n                    \"--register-unsafely-without-email must be provided.\")\n            else:\n                raise errors.Error(\"An e-mail address must be provided.\")\n        elif util.safe_email(email):\n            return email\n        elif suggest_unsafe:\n            msg += unsafe_suggestion\n            suggest_unsafe = False  # add this message at most once\n\n        invalid = bool(email)\n\n\ndef choose_account(accounts):\n    \"\"\"Choose an account.\n\n    :param list accounts: Containing at least one\n        :class:`~certbot.account.Account`\n\n    \"\"\"\n    # Note this will get more complicated once we start recording authorizations\n    labels = [acc.slug for acc in accounts]\n\n    code, index = z_util(interfaces.IDisplay).menu(\n        \"Please choose an account\", labels)\n    if code == display_util.OK:\n        return accounts[index]\n    else:\n        return None\n\n\ndef choose_names(installer):\n    \"\"\"Display screen to select domains to validate.\n\n    :param installer: An installer object\n    :type installer: :class:`certbot.interfaces.IInstaller`\n\n    :returns: List of selected names\n    :rtype: `list` of `str`\n\n    \"\"\"\n    if installer is None:\n        logger.debug(\"No installer, picking names manually\")\n        return _choose_names_manually()\n\n    domains = list(installer.get_all_names())\n    names = get_valid_domains(domains)\n\n    if not names:\n        return _choose_names_manually(\n            \"No names were found in your configuration files. \")\n\n    code, names = _filter_names(names)\n    if code == display_util.OK and names:\n        return names\n    else:\n        return []\n\n\ndef get_valid_domains(domains):\n    \"\"\"Helper method for choose_names that implements basic checks\n     on domain names\n\n    :param list domains: Domain names to validate\n    :return: List of valid domains\n    :rtype: list\n    \"\"\"\n    valid_domains = []\n    for domain in domains:\n        try:\n            valid_domains.append(util.enforce_domain_sanity(domain))\n        except errors.ConfigurationError:\n            continue\n    return valid_domains\n\n\ndef _filter_names(names):\n    \"\"\"Determine which names the user would like to select from a list.\n\n    :param list names: domain names\n\n    :returns: tuple of the form (`code`, `names`) where\n        `code` - str display exit code\n        `names` - list of names selected\n    :rtype: tuple\n\n    \"\"\"\n    code, names = z_util(interfaces.IDisplay).checklist(\n        \"Which names would you like to activate HTTPS for?\",\n        tags=names, cli_flag=\"--domains\")\n    return code, [str(s) for s in names]\n\n\ndef _choose_names_manually(prompt_prefix=\"\"):\n    \"\"\"Manually input names for those without an installer.\n\n    :param str prompt_prefix: string to prepend to prompt for domains\n\n    :returns: list of provided names\n    :rtype: `list` of `str`\n\n    \"\"\"\n    code, input_ = z_util(interfaces.IDisplay).input(\n        prompt_prefix +\n        \"Please enter in your domain name(s) (comma and/or space separated) \",\n        cli_flag=\"--domains\")\n\n    if code == display_util.OK:\n        invalid_domains = dict()\n        retry_message = \"\"\n        try:\n            domain_list = display_util.separate_list_input(input_)\n        except UnicodeEncodeError:\n            domain_list = []\n            retry_message = (\n                \"Internationalized domain names are not presently \"\n                \"supported.{0}{0}Would you like to re-enter the \"\n                \"names?{0}\").format(os.linesep)\n\n        for i, domain in enumerate(domain_list):\n            try:\n                domain_list[i] = util.enforce_domain_sanity(domain)\n            except errors.ConfigurationError as e:\n                try:  # Python 2\n                    # pylint: disable=no-member\n                    err_msg = e.message.encode('utf-8')\n                except AttributeError:\n                    err_msg = str(e)\n                invalid_domains[domain] = err_msg\n\n        if len(invalid_domains):\n            retry_message = (\n                \"One or more of the entered domain names was not valid:\"\n                \"{0}{0}\").format(os.linesep)\n            for domain in invalid_domains:\n                retry_message = retry_message + \"{1}: {2}{0}\".format(\n                    os.linesep, domain, invalid_domains[domain])\n            retry_message = retry_message + (\n                \"{0}Would you like to re-enter the names?{0}\").format(\n                    os.linesep)\n\n        if retry_message:\n            # We had error in input\n            retry = z_util(interfaces.IDisplay).yesno(retry_message)\n            if retry:\n                return _choose_names_manually()\n        else:\n            return domain_list\n    return []\n\n\ndef success_installation(domains):\n    \"\"\"Display a box confirming the installation of HTTPS.\n\n    .. todo:: This should be centered on the screen\n\n    :param list domains: domain names which were enabled\n\n    \"\"\"\n    z_util(interfaces.IDisplay).notification(\n        \"Congratulations! You have successfully enabled {0}{1}{1}\"\n        \"You should test your configuration at:{1}{2}\".format(\n            _gen_https_names(domains),\n            os.linesep,\n            os.linesep.join(_gen_ssl_lab_urls(domains))),\n        height=(10 + len(domains)),\n        pause=False)\n\n\ndef success_renewal(domains, action):\n    \"\"\"Display a box confirming the renewal of an existing certificate.\n\n    .. todo:: This should be centered on the screen\n\n    :param list domains: domain names which were renewed\n    :param str action: can be \"reinstall\" or \"renew\"\n\n    \"\"\"\n    z_util(interfaces.IDisplay).notification(\n        \"Your existing certificate has been successfully {3}ed, and the \"\n        \"new certificate has been installed.{1}{1}\"\n        \"The new certificate covers the following domains: {0}{1}{1}\"\n        \"You should test your configuration at:{1}{2}\".format(\n            _gen_https_names(domains),\n            os.linesep,\n            os.linesep.join(_gen_ssl_lab_urls(domains)),\n            action),\n        height=(14 + len(domains)),\n        pause=False)\n\n\ndef _gen_ssl_lab_urls(domains):\n    \"\"\"Returns a list of urls.\n\n    :param list domains: Each domain is a 'str'\n\n    \"\"\"\n    return [\"https://www.ssllabs.com/ssltest/analyze.html?d=%s\" % dom for dom in domains]\n\n\ndef _gen_https_names(domains):\n    \"\"\"Returns a string of the https domains.\n\n    Domains are formatted nicely with https:// prepended to each.\n\n    :param list domains: Each domain is a 'str'\n\n    \"\"\"\n    if len(domains) == 1:\n        return \"https://{0}\".format(domains[0])\n    elif len(domains) == 2:\n        return \"https://{dom[0]} and https://{dom[1]}\".format(dom=domains)\n    elif len(domains) > 2:\n        return \"{0}{1}{2}\".format(\n            \", \".join(\"https://%s\" % dom for dom in domains[:-1]),\n            \", and https://\",\n            domains[-1])\n\n    return \"\"\n", "path": "certbot/display/ops.py"}]}