Skip to content

Commit

Permalink
Merge pull request #397 from kuba/client-fetch_chain-bugs
Browse files Browse the repository at this point in the history
Fix client to work with cert_chain_uri, "is (not) None" fixes
  • Loading branch information
jdkasten committed May 10, 2015
2 parents ae31b81 + a3c8753 commit 2bfd4d7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions letsencrypt/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, config, account_, dv_auth, installer):
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")
Expand Down Expand Up @@ -172,13 +172,13 @@ def save_certificate(self, certr, cert_path, chain_path):
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:
Expand Down

0 comments on commit 2bfd4d7

Please sign in to comment.