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 committed by GitHub
parent e1af4ddda3
commit 47ad8e08be

View File

@ -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))