mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:02:52 +02:00
Merge pull request #545 from letsencrypt/ssl_labs_urls
Add SSLLab URLs at the end of installation
This commit is contained in:
@@ -205,8 +205,22 @@ def success_installation(domains):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
util(interfaces.IDisplay).notification(
|
util(interfaces.IDisplay).notification(
|
||||||
"Congratulations! You have successfully enabled "
|
"Congratulations! You have successfully enabled {0}!{1}{1}"
|
||||||
"%s!" % _gen_https_names(domains), pause=False)
|
"You should test your configuration at:{1}{2}".format(
|
||||||
|
_gen_https_names(domains),
|
||||||
|
os.linesep,
|
||||||
|
os.linesep.join(_gen_ssl_lab_urls(domains))),
|
||||||
|
height=(10 + len(domains)),
|
||||||
|
pause=False)
|
||||||
|
|
||||||
|
|
||||||
|
def _gen_ssl_lab_urls(domains):
|
||||||
|
"""Returns a list of urls.
|
||||||
|
|
||||||
|
:param list domains: Each domain is a 'str'
|
||||||
|
|
||||||
|
"""
|
||||||
|
return ["https://www.ssllabs.com/ssltest/analyze.html?d=%s" % dom for dom in domains]
|
||||||
|
|
||||||
|
|
||||||
def _gen_https_names(domains):
|
def _gen_https_names(domains):
|
||||||
|
|||||||
@@ -182,6 +182,24 @@ class ChooseAccountTest(unittest.TestCase):
|
|||||||
self.assertTrue(self._call([self.acc1, self.acc2]) is None)
|
self.assertTrue(self._call([self.acc1, self.acc2]) is None)
|
||||||
|
|
||||||
|
|
||||||
|
class GenSSLLabURLs(unittest.TestCase):
|
||||||
|
"""Loose test of _gen_ssl_lab_urls. URL can change easily in the future."""
|
||||||
|
def setUp(self):
|
||||||
|
zope.component.provideUtility(display_util.FileDisplay(sys.stdout))
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _call(cls, domains):
|
||||||
|
from letsencrypt.display.ops import _gen_ssl_lab_urls
|
||||||
|
return _gen_ssl_lab_urls(domains)
|
||||||
|
|
||||||
|
def test_zero(self):
|
||||||
|
self.assertEqual(self._call([]), [])
|
||||||
|
|
||||||
|
def test_two(self):
|
||||||
|
urls = self._call(["eff.org", "umich.edu"])
|
||||||
|
self.assertTrue("eff.org" in urls[0])
|
||||||
|
self.assertTrue("umich.edu" in urls[1])
|
||||||
|
|
||||||
class GenHttpsNamesTest(unittest.TestCase):
|
class GenHttpsNamesTest(unittest.TestCase):
|
||||||
"""Test _gen_https_names."""
|
"""Test _gen_https_names."""
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user