diff --git a/cmd/common-main.go b/cmd/common-main.go index 3a573770d..ef253bf43 100644 --- a/cmd/common-main.go +++ b/cmd/common-main.go @@ -34,6 +34,7 @@ import ( "sort" "strconv" "strings" + "syscall" "time" fcolor "github.com/fatih/color" @@ -718,6 +719,10 @@ func getTLSConfig() (x509Certs []*x509.Certificate, manager *certs.Manager, secu } } secureConn = true + + // syscall.SIGHUP to reload the certs. + manager.ReloadOnSignal(syscall.SIGHUP) + return x509Certs, manager, secureConn, nil } diff --git a/cmd/utils.go b/cmd/utils.go index f71f8040f..3ca474b41 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -40,6 +40,7 @@ import ( "sort" "strings" "sync" + "syscall" "time" "github.com/dustin/go-humanize" @@ -597,6 +598,7 @@ func NewGatewayHTTPTransportWithClientCerts(clientCert, clientKey string) *http. err.Error())) } if c != nil { + c.ReloadOnSignal(syscall.SIGHUP) // allow reloads upon SIGHUP transport.TLSClientConfig.GetClientCertificate = c.GetClientCertificate } } diff --git a/internal/event/target/webhook.go b/internal/event/target/webhook.go index 16ec1de07..244df29ff 100644 --- a/internal/event/target/webhook.go +++ b/internal/event/target/webhook.go @@ -31,6 +31,7 @@ import ( "os" "path/filepath" "strings" + "syscall" "time" "github.com/minio/minio/internal/event" @@ -238,6 +239,7 @@ func NewWebhookTarget(ctx context.Context, id string, args WebhookArgs, loggerOn if err != nil { return target, err } + manager.ReloadOnSignal(syscall.SIGHUP) // allow reloads upon SIGHUP transport.TLSClientConfig.GetClientCertificate = manager.GetClientCertificate } target.httpClient = &http.Client{Transport: transport}