From 76b07017454dbe6b65f3e45ca587c57e607bb44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Rom=C3=A3o=20Barcala?= Date: Thu, 27 Nov 2025 13:18:15 +0000 Subject: [PATCH] tls_manager.go: handle case when either TLS pair files exist --- tls_manager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tls_manager.go b/tls_manager.go index 076cf44bc..242fd378b 100644 --- a/tls_manager.go +++ b/tls_manager.go @@ -208,8 +208,8 @@ func (t *TLSManager) generateOrRenewCert() (*tls.Config, error) { // is already written to disk, this function overwrites the plaintext key with // the encrypted form. func (t *TLSManager) generateCertPair(keyRing keychain.SecretKeyRing) error { - // Ensure we create TLS key and certificate if they don't exist. - if lnrpc.FileExists(t.cfg.TLSCertPath) || + // Ensure we create TLS key and certificate if they don't both exist. + if lnrpc.FileExists(t.cfg.TLSCertPath) && lnrpc.FileExists(t.cfg.TLSKeyPath) { // Handle discrepencies related to the TLSEncryptKey setting.