Greetings, 

today I setup a new instance of Prosody 0.10 and wanted to try out the 
built in Let's Encrypt support.
I ran 
prosodyctl --root cert import /var/lib/acme/live
as I use acmetool [0] as my LE client but it didn't work as the filename 
structure of acmetool is slightly different from the one certbot uses.

After a brief session with strace and some looking around in the prosodyctl 
source I wrote a simple patch that makes certmanager also inspect correctly 
named files in a subfolder with the hostname without the .pem extension.

I hope this will be included in a future release of prosody as I'd like to 
continue using acmetool and not patch Prosody on every new release.

Regards
Daniel

[0] https://github.com/hlandau/acme

-- 
You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# User Daniel Schulte <[email protected]>
# Date 1513540332 -3600
#      Sun Dec 17 20:52:12 2017 +0100
# Node ID 1bf3a40e5549962d0ad075338ccbcf6c50bb15fb
# Parent  d88dc682767557dd614faa3450f017a665bf6a36
certmanager: Also look for cert/key files without .pem extension

Some LE clients such as acmetool save the generated certificate and corresponding key in the correct schema but without the .pem file extension. This causes the cert import functionality to break. This patch makes the find_cert function also look for those files.

diff -r d88dc6827675 -r 1bf3a40e5549 core/certmanager.lua
--- a/core/certmanager.lua	Tue Dec 12 17:51:12 2017 +0100
+++ b/core/certmanager.lua	Sun Dec 17 20:52:12 2017 +0100
@@ -61,8 +61,8 @@
 
 local global_certificates = configmanager.get("*", "certificates") or "certs";
 
-local crt_try = { "", "/%s.crt", "/%s/fullchain.pem", "/%s.pem", };
-local key_try = { "", "/%s.key", "/%s/privkey.pem",   "/%s.pem", };
+local crt_try = { "", "/%s.crt", "/%s/fullchain", "/%s/fullchain.pem", "/%s.pem", };
+local key_try = { "", "/%s.key", "/%s/privkey", "/%s/privkey.pem",   "/%s.pem", };
 
 local function find_cert(user_certs, name)
 	local certs = resolve_path(config_path, user_certs or global_certificates);

Reply via email to