From c0513013d50568245d0104ad841bf882e893d80c Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 19 Mar 2021 09:27:19 +0100 Subject: [PATCH] Fix panic on GetCertificate Fixes the following panic: panic: interface conversion: interface {} is tls.Certificate, not *tls.Certificate --- cmd/soju/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/soju/main.go b/cmd/soju/main.go index 4c0d8ec..7ee179e 100644 --- a/cmd/soju/main.go +++ b/cmd/soju/main.go @@ -57,7 +57,7 @@ func main() { if err != nil { log.Fatalf("failed to load TLS certificate and key: %v", err) } - tlsCert.Store(cert) + tlsCert.Store(&cert) tlsCfg = &tls.Config{ GetCertificate: func(*tls.ClientHelloInfo) (*tls.Certificate, error) { @@ -204,7 +204,7 @@ func main() { log.Printf("failed to reload TLS certificate and key: %v", err) break } - tlsCert.Store(cert) + tlsCert.Store(&cert) } case syscall.SIGINT, syscall.SIGTERM: log.Print("shutting down server")