chore: Random only if the certificate and private-key are empty

This commit is contained in:
Skyxim 2023-05-26 15:00:54 +00:00
parent 2c44b4e170
commit 2af758e5f1

View file

@ -11,7 +11,7 @@ import (
) )
func ParseCert(certificate, privateKey string) (tls.Certificate, error) { func ParseCert(certificate, privateKey string) (tls.Certificate, error) {
if certificate == "" || privateKey == "" { if certificate == "" && privateKey == "" {
return newRandomTLSKeyPair() return newRandomTLSKeyPair()
} }
cert, painTextErr := tls.X509KeyPair([]byte(certificate), []byte(privateKey)) cert, painTextErr := tls.X509KeyPair([]byte(certificate), []byte(privateKey))