From 5a2dff7b747a39d108313114aceb136851ea6bc3 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 29 Sep 2024 21:26:31 +0300 Subject: [PATCH] Make sure that the required slash is present. (#802) --- changelogs/fragments/802-renewal-info.yml | 3 +++ plugins/module_utils/acme/acme.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/802-renewal-info.yml diff --git a/changelogs/fragments/802-renewal-info.yml b/changelogs/fragments/802-renewal-info.yml new file mode 100644 index 00000000..f5eb5216 --- /dev/null +++ b/changelogs/fragments/802-renewal-info.yml @@ -0,0 +1,3 @@ +bugfixes: + - "acme_* modules - when querying renewal information, make sure to insert a slash between the base URL and the certificate identifier + (https://github.com/ansible-collections/community.crypto/issues/801, https://github.com/ansible-collections/community.crypto/pull/802)." diff --git a/plugins/module_utils/acme/acme.py b/plugins/module_utils/acme/acme.py index 7f9b954c..ab57e8b2 100644 --- a/plugins/module_utils/acme/acme.py +++ b/plugins/module_utils/acme/acme.py @@ -404,7 +404,7 @@ class ACMEClient(object): if cert_id is None: cert_id = compute_cert_id(self.backend, cert_info=cert_info, cert_filename=cert_filename, cert_content=cert_content) - url = '{base}{cert_id}'.format(base=self.directory.directory['renewalInfo'], cert_id=cert_id) + url = '{base}/{cert_id}'.format(base=self.directory.directory['renewalInfo'].rstrip('/'), cert_id=cert_id) data, info = self.get_request(url, parse_json_result=True, fail_on_error=True, get_only=True)