From 561a6e32aaef98eccb0ad2dbbe6807a26cb06cb3 Mon Sep 17 00:00:00 2001 From: a Date: Wed, 19 Jun 2024 21:20:16 -0500 Subject: [PATCH] noot --- modules/caddytls/tls.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/caddytls/tls.go b/modules/caddytls/tls.go index b30b10c24ad5..67a4725ca3d5 100644 --- a/modules/caddytls/tls.go +++ b/modules/caddytls/tls.go @@ -24,6 +24,7 @@ import ( "runtime/debug" "sync" "time" + "unsafe" "github.com/caddyserver/certmagic" "go.uber.org/zap" @@ -146,7 +147,9 @@ func (t *TLS) Provision(ctx caddy.Context) error { certCacheMu.Lock() if certCache == nil { certCache = certmagic.NewCache(cacheOpts) + fmt.Println("creating cert cache", unsafe.Pointer(certCache)) } else { + fmt.Println("reusing cert cache", unsafe.Pointer(certCache)) certCache.SetOptions(cacheOpts) } certCacheMu.Unlock() @@ -356,6 +359,7 @@ func (t *TLS) Stop() error { // Cleanup frees up resources allocated during Provision. func (t *TLS) Cleanup() error { + fmt.Println("cleanup called cert cache", unsafe.Pointer(certCache)) // stop the session ticket rotation goroutine if t.SessionTickets != nil { t.SessionTickets.stop() @@ -401,6 +405,7 @@ func (t *TLS) Cleanup() error { // remove the certs certCacheMu.RLock() + fmt.Println("washing cert cache", unsafe.Pointer(certCache)) certCache.RemoveManaged(noLongerManaged) certCache.Remove(noLongerLoaded) certCacheMu.RUnlock() @@ -417,6 +422,7 @@ func (t *TLS) Cleanup() error { certCache.Stop() certCacheMu.Lock() certCache = nil + fmt.Println("deleting cert cache", unsafe.Pointer(certCache)) certCacheMu.Unlock() }