Verified Commit 8b316430 authored by Vladimír Čunát's avatar Vladimír Čunát Committed by Tomas Krizek

modules/http ephemeral cert: update before expiration

Instead of three days after.  This bug was not introduced by the recent
commits moving the code.
parent 7d9e7c8f
Pipeline #49366 canceled with stages
in 6 minutes and 6 seconds
......@@ -71,8 +71,8 @@ function tls_cert.ephemeral_state_maintain(ephem_state, certfile, keyfile)
s.config.ctx = ephem_state.ctx -- not required, but let's keep it synchonized
end
log('[http] created new ephemeral TLS certificate')
local _, lifetime_sec = certs[1]:getLifetime()
local wait_msec = 1000 * math.max(1, lifetime_sec - (os.time() - 3 * 24 * 3600))
local _, expiry_stamp = certs[1]:getLifetime()
local wait_msec = 1000 * math.max(1, expiry_stamp - os.time() - 3 * 24 * 3600)
if not ephem_state.timer_id then
ephem_state.timer_id = event.after(wait_msec, function ()
tls_cert.ephemeral_state_maintain(ephem_state, certfile, keyfile)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment