mirror of
https://github.com/bjc/prosody.git
synced 2025-04-01 20:27:39 +03:00
certmanager: Add more debug logging around cert indexing
Currently it's not obvious which directories have been indexed (especially when the resulting index is empty), or why certain files have been skipped.
This commit is contained in:
parent
e52cc0126d
commit
faf20e5dc9
1 changed files with 6 additions and 2 deletions
|
@ -91,7 +91,7 @@ local function index_certs(dir, files_by_name, depth_limit)
|
|||
index_certs(full, files_by_name, depth_limit-1);
|
||||
end
|
||||
elseif file:find("%.crt$") or file:find("fullchain") then -- This should catch most fullchain files
|
||||
local f = io_open(full);
|
||||
local f, err = io_open(full);
|
||||
if f then
|
||||
-- TODO look for chained certificates
|
||||
local firstline = f:read();
|
||||
|
@ -113,13 +113,17 @@ local function index_certs(dir, files_by_name, depth_limit)
|
|||
files_by_name[name] = { [full] = services; };
|
||||
end
|
||||
end
|
||||
else
|
||||
log("debug", "Skipping expired certificate: %s", full);
|
||||
end
|
||||
end
|
||||
f:close();
|
||||
elseif err then
|
||||
log("debug", "Failed to open file for indexing: %s", full);
|
||||
end
|
||||
end
|
||||
end
|
||||
log("debug", "Certificate index: %q", files_by_name);
|
||||
log("debug", "Certificate index in %s: %q", dir, files_by_name);
|
||||
-- | hostname | filename | service |
|
||||
return files_by_name;
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue