Reload the TLS certificate without a restart

Aperta
#438 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
backend, security

Direzione di ricerca

Start with cmd/fanout/main.go and internal/server/http.go to trace how TLS is configured, then read internal/server/clientca.go and the TLS guide at site/src/content/docs/docs/guides/tls.mdx. Check the existing server tests for certificate loading and connection behavior. Done when the acceptance criteria pass, including keeping the last good certificate on invalid or mismatched file updates, and the TLS guide explains the client CA restart requirement.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What

Fanout reads FANOUT_TLS_CERT_FILE and FANOUT_TLS_KEY_FILE once, through ListenAndServeTLS, so a renewed certificate needs a restart. A restart interrupts ingest on a single-node product, and anyone renewing with certbot or a similar tool hits this at every renewal.

Serve the certificate through a tls.Config.GetCertificate callback that picks up changed files, with no new settings.

Acceptance criteria

  • A new handshake uses the renewed certificate after the files change, with no restart
  • Existing connections, including long-lived gRPC streams, are not dropped by a reload
  • A partial or invalid pair on disk keeps the last good certificate and logs an error that names the path, never file contents
  • A cert and key written at slightly different times never produce a mismatched pair
  • Startup still fails on an unreadable or invalid pair
  • TLS 1.3, ALPN h2, and FANOUT_TLS_CLIENT_CA_FILE behave as before
  • The file check does not add file reads to every handshake without a bound
  • TLS guide updated, including that the client CA bundle still needs a restart

References

  • cmd/fanout/main.go (ListenAndServeTLS)
  • internal/server/http.go
  • internal/server/clientca.go
  • site/src/content/docs/docs/guides/tls.mdx

One pull request. Use the latest stable version of any dependency added, verified against its registry and pinned exactly.

Lingua principale
Go
Stelle
11
Fork
0
Merge medio
7h 5m
PR unite (30g)
112

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di labstack/fanout

Tutte le issue di labstack/fanout

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.