Skip to content

Commit c7fe642

Browse files
thiagorbmohamedawnallah
authored andcommitted
tls_manager.go: handle case when either TLS pair files exist
1 parent c9dea6d commit c7fe642

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tls_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ func (t *TLSManager) generateOrRenewCert() (*tls.Config, error) {
208208
// is already written to disk, this function overwrites the plaintext key with
209209
// the encrypted form.
210210
func (t *TLSManager) generateCertPair(keyRing keychain.SecretKeyRing) error {
211-
// Ensure we create TLS key and certificate if they don't exist.
212-
if lnrpc.FileExists(t.cfg.TLSCertPath) ||
211+
// Ensure we create TLS key and certificate if they don't both exist.
212+
if lnrpc.FileExists(t.cfg.TLSCertPath) &&
213213
lnrpc.FileExists(t.cfg.TLSKeyPath) {
214214

215215
// Handle discrepencies related to the TLSEncryptKey setting.

0 commit comments

Comments
 (0)