Skip to content

Commit

Permalink
chore: Random only if the certificate and private-key are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyxim authored Jun 3, 2023
1 parent e1af4dd commit 47ad8e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/net/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 47ad8e0

Please sign in to comment.