SSL Cert FIX

This commit is contained in:
2026-08-06 00:21:59 -03:00
parent 54981f7348
commit 809e2aeb82
9 changed files with 1326 additions and 5 deletions
+26
View File
@@ -199,6 +199,32 @@ func (p *tlsListenerPool) Has(addr string) bool {
return ok
}
// Drop closes the listeners for the given addresses so a following Sync rebinds
// them. Used after a certificate is replaced on disk: tls.Listen captures the
// certificate when the listener is created, so the socket has to be recreated
// for new material to be served. Accepted connections are not owned by the pool
// and keep running.
func (p *tlsListenerPool) Drop(addrs []string, reason string) {
if p == nil {
return
}
p.mu.Lock()
defer p.mu.Unlock()
for _, addr := range addrs {
entry, ok := p.entries[addr]
if !ok {
continue
}
_ = entry.Close()
delete(p.entries, addr)
if reason != "" {
log.Printf("hotreload: dropped TLS %s (%s)", addr, reason)
} else {
log.Printf("hotreload: dropped TLS %s", addr)
}
}
}
func (p *tlsListenerPool) StopAll(reason string) {
if p == nil {
return