From 47ad8e08beb6f00aa2c162c08d9520895094d380 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Fri, 26 May 2023 15:00:54 +0000 Subject: [PATCH] chore: Random only if the certificate and private-key are empty --- common/net/tls.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/net/tls.go b/common/net/tls.go index 5e1c81f20f..e51324f7c2 100644 --- a/common/net/tls.go +++ b/common/net/tls.go @@ -11,7 +11,7 @@ import ( ) func ParseCert(certificate, privateKey string) (tls.Certificate, error) { - if certificate == "" || privateKey == "" { + if certificate == "" && privateKey == "" { return newRandomTLSKeyPair() } cert, painTextErr := tls.X509KeyPair([]byte(certificate), []byte(privateKey))