also expose pem cert uid in certificate.call function

This commit is contained in:
Elvin Efendi 2020-02-19 13:41:50 -05:00
parent 4bb9106be2
commit ad78425852
2 changed files with 23 additions and 16 deletions

View file

@ -37,7 +37,7 @@ local function fetch_request_body()
return body
end
function _M.get_pem_cert_key(hostname)
local function get_pem_cert(hostname)
local uid = certificate_servers:get(hostname)
if not uid then
return nil
@ -143,7 +143,7 @@ local function handle_certs()
return
end
local key = _M.get_pem_cert_key(query["hostname"])
local key = get_pem_cert(query["hostname"])
if key then
ngx.status = ngx.HTTP_OK
ngx.print(key)