aboutsummaryrefslogtreecommitdiffstats
path: root/util/prosodyctl
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-22 18:34:11 +0100
committerKim Alvefur <zash@zash.se>2021-12-22 18:34:11 +0100
commit1c904b2ed3d83b56ec7650e981c156a9df63de4e (patch)
tree09b317fb394db43e04762ca61225a59ad6f3ea08 /util/prosodyctl
parent1f4fb79d2e9d40fb1468681044d39f03d5bef273 (diff)
downloadprosody-1c904b2ed3d83b56ec7650e981c156a9df63de4e.tar.gz
prosody-1c904b2ed3d83b56ec7650e981c156a9df63de4e.zip
util.prosodyctl.cert: Copy SAN/wildcard certs only once
Diffstat (limited to 'util/prosodyctl')
-rw-r--r--util/prosodyctl/cert.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/prosodyctl/cert.lua b/util/prosodyctl/cert.lua
index d37bb82c..4461182d 100644
--- a/util/prosodyctl/cert.lua
+++ b/util/prosodyctl/cert.lua
@@ -223,10 +223,14 @@ function cert_commands.import(arg)
local imported = {};
for _, host in ipairs(hostnames) do
local paths = cm.find_cert_in_index(files_by_name, host);
- if paths then
+ if paths and not imported[paths.certificate] then
+ -- One certificate, many mames!
+ table.insert(imported, host);
+ elseif paths then
copy(paths.certificate, cert_basedir .. "/" .. host .. ".crt", nil, owner, group);
copy(paths.key, cert_basedir .. "/" .. host .. ".key", "0377", owner, group);
table.insert(imported, host);
+ imported[paths.certificate] = true;
else
-- TODO Say where we looked
pctl.show_warning("No certificate for host "..host.." found :(");