summaryrefslogtreecommitdiff
path: root/modules/caddytls/distributedstek
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddytls/distributedstek')
-rw-r--r--modules/caddytls/distributedstek/distributedstek.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/caddytls/distributedstek/distributedstek.go b/modules/caddytls/distributedstek/distributedstek.go
index 807f2bb..f29db29 100644
--- a/modules/caddytls/distributedstek/distributedstek.go
+++ b/modules/caddytls/distributedstek/distributedstek.go
@@ -53,6 +53,7 @@ type Provider struct {
storage certmagic.Storage
stekConfig *caddytls.SessionTicketService
timer *time.Timer
+ ctx caddy.Context
}
// CaddyModule returns the Caddy module information.
@@ -65,6 +66,8 @@ func (Provider) CaddyModule() caddy.ModuleInfo {
// Provision provisions s.
func (s *Provider) Provision(ctx caddy.Context) error {
+ s.ctx = ctx
+
// unpack the storage module to use, if different from the default
if s.Storage != nil {
val, err := ctx.LoadModule(s, "Storage")
@@ -142,7 +145,7 @@ func (s *Provider) storeSTEK(dstek distributedSTEK) error {
// current STEK is outdated (NextRotation time is in the past),
// then it is rotated and persisted. The resulting STEK is returned.
func (s *Provider) getSTEK() (distributedSTEK, error) {
- s.storage.Lock(stekLockName)
+ s.storage.Lock(s.ctx, stekLockName)
defer s.storage.Unlock(stekLockName)
// load the current STEKs from storage