MCPcopy
hub / github.com/caddyserver/certmagic / CleanUp

Method CleanUp

solvers.go:227–242  ·  view source on GitHub ↗

CleanUp removes the challenge certificate from the cache, and if it is the last one to finish, stops the TLS server.

(_ context.Context, chal acme.Challenge)

Source from the content-addressed store, hash-verified

225// CleanUp removes the challenge certificate from the cache, and if
226// it is the last one to finish, stops the TLS server.
227func (s *tlsALPNSolver) CleanUp(_ context.Context, chal acme.Challenge) error {
228 solversMu.Lock()
229 defer solversMu.Unlock()
230 si := getSolverInfo(s.address)
231 si.count--
232 if si.count == 0 {
233 // last one out turns off the lights
234 atomic.StoreInt32(&si.closed, 1)
235 if si.listener != nil {
236 si.listener.Close()
237 <-si.done
238 }
239 delete(solvers, s.address)
240 }
241 return nil
242}
243
244// DNS01Solver is a type that makes libdns providers usable as ACME dns-01
245// challenge solvers. See https://github.com/libdns/libdns

Callers

nothing calls this directly

Calls 4

getSolverInfoFunction · 0.85
CloseMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected