From a3ce2e2eb912f502d11f49d08193a277aaaa513d Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Wed, 4 May 2016 19:54:53 -0400 Subject: [PATCH] Fixed #46 -- allow using relative paths for account key --- letsencrypt-aws.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/letsencrypt-aws.py b/letsencrypt-aws.py index 71875f7..283eebb 100644 --- a/letsencrypt-aws.py +++ b/letsencrypt-aws.py @@ -422,7 +422,13 @@ def update_elbs(logger, acme_client, force_issue, certificate_requests): def setup_acme_client(s3_client, acme_directory_url, acme_account_key): uri = rfc3986.urlparse(acme_account_key) if uri.scheme == "file": - with open(uri.path) as f: + if uri.host is None: + path = uri.path + elif uri.path is None: + path = uri.host + else: + path = os.path.join(uri.host, uri.path) + with open(path) as f: key = f.read() elif uri.scheme == "s3": # uri.path includes a leading "/"