CleanUp cleans up the HTTP server if it is the last one to finish.
(_ context.Context, _ acme.Challenge)
| 104 | |
| 105 | // CleanUp cleans up the HTTP server if it is the last one to finish. |
| 106 | func (s *httpSolver) CleanUp(_ context.Context, _ acme.Challenge) error { |
| 107 | solversMu.Lock() |
| 108 | defer solversMu.Unlock() |
| 109 | si := getSolverInfo(s.address) |
| 110 | si.count-- |
| 111 | if si.count == 0 { |
| 112 | // last one out turns off the lights |
| 113 | atomic.StoreInt32(&s.closed, 1) |
| 114 | if si.listener != nil { |
| 115 | si.listener.Close() |
| 116 | <-si.done |
| 117 | } |
| 118 | delete(solvers, s.address) |
| 119 | } |
| 120 | return nil |
| 121 | } |
| 122 | |
| 123 | // tlsALPNSolver is a type that can solve TLS-ALPN challenges. |
| 124 | // It must have an associated config and address on which to |