Software /
code /
prosody
Comparison
core/certmanager.lua @ 12507:e242a6e74424 0.12
core.certmanager: Expand debug messages about cert lookups in index
Answers my recurring question of
> Using cert "certs/example.com.crt" from index
... for what?
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 16 May 2022 11:39:17 +0200 |
parent | 12362:0fd58f54d653 |
child | 12508:e6cfd0a6f0da |
child | 13178:e689d4c45681 |
comparison
equal
deleted
inserted
replaced
12505:604bb5b8362d | 12507:e242a6e74424 |
---|---|
157 local wildcard_host = host:gsub("^[^.]+%.", "*."); | 157 local wildcard_host = host:gsub("^[^.]+%.", "*."); |
158 local certs = index[host] or index[wildcard_host]; | 158 local certs = index[host] or index[wildcard_host]; |
159 if certs then | 159 if certs then |
160 local cert_filename, services = next(certs); | 160 local cert_filename, services = next(certs); |
161 if services["*"] then | 161 if services["*"] then |
162 log("debug", "Using cert %q from index", cert_filename); | 162 log("debug", "Using cert %q from index for host %q", cert_filename, host); |
163 return { | 163 return { |
164 certificate = cert_filename, | 164 certificate = cert_filename, |
165 key = find_matching_key(cert_filename), | 165 key = find_matching_key(cert_filename), |
166 } | 166 } |
167 end | 167 end |
183 cert_index = index_certs(resolve_path(config_path, global_certificates)); | 183 cert_index = index_certs(resolve_path(config_path, global_certificates)); |
184 end | 184 end |
185 for _, certs in pairs(cert_index) do | 185 for _, certs in pairs(cert_index) do |
186 for cert_filename, services in pairs(certs) do | 186 for cert_filename, services in pairs(certs) do |
187 if services[service] or services["*"] then | 187 if services[service] or services["*"] then |
188 log("debug", "Using cert %q from index", cert_filename); | 188 log("debug", "Using cert %q from index for service %s port %d", cert_filename, service, port); |
189 return { | 189 return { |
190 certificate = cert_filename, | 190 certificate = cert_filename, |
191 key = find_matching_key(cert_filename), | 191 key = find_matching_key(cert_filename), |
192 } | 192 } |
193 end | 193 end |