From ba38bda5f06843e0c3add40130efb615b58bf21e Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Wed, 5 Feb 2020 13:51:48 +0100 Subject: [PATCH] lnd: reload cert data after renewal After renewing the certificate, the new certificate wasn't actually loaded and used, causing the old one to be used until lnd was restarted. This fixes that by reloading it after it has been written. --- lnd.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lnd.go b/lnd.go index 1a28cebc..a080f5a7 100644 --- a/lnd.go +++ b/lnd.go @@ -757,6 +757,12 @@ func getTLSConfig(tlsCertPath string, tlsKeyPath string, tlsExtraIPs, return nil, nil, "", err } rpcsLog.Infof("Done renewing TLS certificates") + + // Reload the certificate data. + certData, _, err = cert.LoadCert(tlsCertPath, tlsKeyPath) + if err != nil { + return nil, nil, "", err + } } tlsCfg := cert.TLSConfFromCert(certData)