From 2af758e5f1c0958f969ad2344c7acefeee3e196d 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 5e1c81f2..e51324f7 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))