From a3c8753dcf48966e46c29a0d6ccd84d9fd198d07 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 9 May 2015 15:09:29 +0000 Subject: [PATCH 1/3] Fix client to work with cert_chain_uri, "is (not) None" fixes --- letsencrypt/client/client.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/letsencrypt/client/client.py b/letsencrypt/client/client.py index 8518c56b9..ba3e0299b 100644 --- a/letsencrypt/client/client.py +++ b/letsencrypt/client/client.py @@ -77,7 +77,7 @@ class Client(object): def register(self): """New Registration with the ACME server.""" self.account = self.network.register_from_account(self.account) - if self.account.terms_of_service: + if self.account.terms_of_service is not None: if not self.config.tos: # TODO: Replace with self.account.terms_of_service eula = pkg_resources.resource_string("letsencrypt", "EULA") @@ -172,13 +172,13 @@ class Client(object): logging.info("Server issued certificate; certificate written to %s", act_cert_path) - if certr.cert_chain_uri: + if certr.cert_chain_uri is not None: # TODO: Except - chain_cert = self.network.fetch_chain(certr.cert_chain_uri) - if chain_cert: + chain_cert = self.network.fetch_chain(certr) + if chain_cert is not None: chain_file, act_chain_path = le_util.unique_file( chain_path, 0o644) - chain_pem = chain_cert.to_pem() + chain_pem = chain_cert.as_pem() try: chain_file.write(chain_pem) finally: From 771ddf0aaf007bb9fb967ec46cdca1cf39d1cc9f Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sun, 10 May 2015 14:53:59 +0000 Subject: [PATCH 2/3] Update docs for the new CLI --- README.rst | 10 +++++++--- docs/using.rst | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index fac36dbd7..4f170f11b 100644 --- a/README.rst +++ b/README.rst @@ -17,11 +17,15 @@ It's all automated: * If domain control has been proven, a certificate will get issued and the tool will automatically install it. -All you need to do is: +All you need to do is:: -:: + user@www:~$ sudo letsencrypt -d www.example.org auth - user@www:~$ sudo letsencrypt -d www.example.org +and if you have a compatbile web server (Apache), Let's Encrypt can +not only get a new certificate, but also deploy it and configure your +server automatically!:: + + user@www:~$ sudo letsencrypt -d www.example.org run **Encrypt ALL the things!** diff --git a/docs/using.rst b/docs/using.rst index f10966602..daa2425ea 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -54,7 +54,6 @@ Installation virtualenv --no-site-packages -p python2 venv ./venv/bin/pip install -r requirements.txt - sudo ./venv/bin/letsencrypt Usage From a5e927c657a127a4079c17470a5b3f211c8460fb Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sun, 10 May 2015 14:56:44 +0000 Subject: [PATCH 3/3] name_with_description -> description_with_name --- letsencrypt/client/display/ops.py | 2 +- letsencrypt/client/plugins/disco.py | 6 +++--- letsencrypt/client/plugins/disco_test.py | 7 ++++--- letsencrypt/client/tests/display/ops_test.py | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/letsencrypt/client/display/ops.py b/letsencrypt/client/display/ops.py index dc6992c8c..706e8bd7c 100644 --- a/letsencrypt/client/display/ops.py +++ b/letsencrypt/client/display/ops.py @@ -22,7 +22,7 @@ def choose_plugin(prepared, question): :rtype: `~.PluginEntryPoint` """ - opts = [plugin_ep.name_with_description + opts = [plugin_ep.description_with_name + (" [Misconfigured]" if plugin_ep.misconfigured else "") for plugin_ep in prepared] diff --git a/letsencrypt/client/plugins/disco.py b/letsencrypt/client/plugins/disco.py index 50e0bce50..6ab110a20 100644 --- a/letsencrypt/client/plugins/disco.py +++ b/letsencrypt/client/plugins/disco.py @@ -39,9 +39,9 @@ class PluginEntryPoint(object): return self.plugin_cls.description @property - def name_with_description(self): - """Name with description. Handy for UI.""" - return "{0} ({1})".format(self.name, self.description) + def description_with_name(self): + """Description with name. Handy for UI.""" + return "{0} ({1})".format(self.description, self.name) def ifaces(self, *ifaces_groups): """Does plugin implements specified interface groups?""" diff --git a/letsencrypt/client/plugins/disco_test.py b/letsencrypt/client/plugins/disco_test.py index f5ea9e6ee..88aa1275c 100644 --- a/letsencrypt/client/plugins/disco_test.py +++ b/letsencrypt/client/plugins/disco_test.py @@ -52,9 +52,10 @@ class PluginEntryPointTest(unittest.TestCase): def test_description(self): self.assertEqual("Standalone Authenticator", self.plugin_ep.description) - def test_name_with_description(self): - self.assertTrue( - self.plugin_ep.name_with_description.startswith("sa (")) + def test_description_with_name(self): + self.plugin_ep.plugin_cls = mock.MagicMock(description="Desc") + self.assertEqual( + "Desc (sa)", self.plugin_ep.description_with_name) def test_ifaces(self): self.assertTrue(self.plugin_ep.ifaces((interfaces.IAuthenticator,))) diff --git a/letsencrypt/client/tests/display/ops_test.py b/letsencrypt/client/tests/display/ops_test.py index 7c5c1f74f..4716a5b11 100644 --- a/letsencrypt/client/tests/display/ops_test.py +++ b/letsencrypt/client/tests/display/ops_test.py @@ -20,9 +20,9 @@ class ChoosePluginTest(unittest.TestCase): def setUp(self): zope.component.provideUtility(display_util.FileDisplay(sys.stdout)) self.mock_apache = mock.Mock( - name_with_description="a", misconfigured=True) + description_with_name="a", misconfigured=True) self.mock_stand = mock.Mock( - name_with_description="s", misconfigured=False) + description_with_name="s", misconfigured=False) self.mock_stand.init().more_info.return_value = "standalone" self.plugins = [ self.mock_apache,