Skip to content

Commit e7d7c39

Browse files
committed
Don't store cert backups
Those are inconvenient if you don't want to run Redis as LRU cache. We are more interested in not silently discarding any certificates, and scaling Redis with increasing number of domains, so we don't. If this change is not acceptable, another scheme could be to store the previous (":old") certificate in addition to the current one (":latest"). This way we'd only be storing at most two certificates per domain in Redis, and not a growing number due to renewals.
1 parent 0c7b608 commit e7d7c39

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

lib/resty/auto-ssl/storage.lua

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ function _M.set_cert(self, domain, fullchain_pem, privkey_pem, cert_pem, expiry)
5656
return nil, err
5757
end
5858

59-
-- Store the cert with the current timestamp, so the old certs are preserved
60-
-- in case something goes wrong.
61-
local time = ngx.now() * 1000
62-
self.adapter:set(domain .. ":" .. time, string)
63-
6459
-- Store the cert under the "latest" alias, which is what this app will use.
6560
return self.adapter:set(domain .. ":latest", string)
6661
end

0 commit comments

Comments
 (0)