better logging in certificate.lua
This commit is contained in:
parent
11539da09d
commit
f067712824
1 changed files with 9 additions and 1 deletions
|
@ -50,12 +50,20 @@ function _M.call()
|
|||
ngx.log(ngx.ERR, "Error getting the hostname, falling back on default certificate: " .. hostname_err)
|
||||
return
|
||||
end
|
||||
if not hostname then
|
||||
ngx.log(ngx.INFO, "hostname can not be obtained, falling back to default certificate")
|
||||
return
|
||||
end
|
||||
|
||||
local pem_cert_key = get_pem_cert_key(hostname)
|
||||
if not pem_cert_key or pem_cert_key == "" then
|
||||
if not pem_cert_key then
|
||||
ngx.log(ngx.ERR, "Certificate not found, falling back on default certificate for hostname: " .. tostring(hostname))
|
||||
return
|
||||
end
|
||||
if pem_cert_key == "" then
|
||||
ngx.log(ngx.ERR, "Certificate is empty, falling back on default certificate for hostname: " .. tostring(hostname))
|
||||
return
|
||||
end
|
||||
|
||||
local clear_ok, clear_err = ssl.clear_certs()
|
||||
if not clear_ok then
|
||||
|
|
Loading…
Reference in a new issue