Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not returning ERR correctly in update_cert_handler #24

Closed
cdloh opened this issue Jan 12, 2021 · 2 comments
Closed

Not returning ERR correctly in update_cert_handler #24

cdloh opened this issue Jan 12, 2021 · 2 comments

Comments

@cdloh
Copy link
Contributor

cdloh commented Jan 12, 2021

Whilst working on #20 I noted that errors aren't being returned in update_cert_handler

if err then
log(ngx_ERR, "error updating cert for ", domain, " err: ", err)
return
end
local serialized = json.encode({
domain = domain,
pkey = pkey,
cert = cert,
type = typ,
updated = ngx.now(),
})
local err = AUTOSSL.storage:set(domain_cache_key, serialized)
if err then
log(ngx_ERR, "error storing cert and key to storage ", err)
return
end

The code is relying on that error for further down

err = update_cert_handler(data)
-- yes we don't release lock, but wait it to expire after negative cache is cleared
return err
end

Unless I'm missing something?

@fffonion
Copy link
Owner

fffonion commented Jan 12, 2021 via email

cdloh pushed a commit to cdloh/lua-resty-acme that referenced this issue Jan 12, 2021
@cdloh
Copy link
Contributor Author

cdloh commented Jan 12, 2021

I've submitted an MR but feel free not to use incase you want to change the logging around as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants