Allow setting CN of client certs, for apps which use it for usenames.

This commit is contained in:
Solderpunk 2020-07-09 12:42:05 +02:00
parent 4fd7d4d9be
commit 2357f81d67

View File

@ -90,8 +90,12 @@ func getServerCertTemplate(domain string, notBefore time.Time, notAfter time.Tim
return template return template
} }
func getClientCertTemplate(domain string, notBefore time.Time, notAfter time.Time) x509.Certificate { func getClientCertTemplate(cn string, notBefore time.Time, notAfter time.Time) x509.Certificate {
return getCommonCertTemplate(notBefore, notAfter) template := getCommonCertTemplate(notBefore, notAfter)
template.Subject = pkix.Name{
CommonName: cn,
}
return template
} }
func getCommonCertTemplate(notBefore time.Time, notAfter time.Time) x509.Certificate { func getCommonCertTemplate(notBefore time.Time, notAfter time.Time) x509.Certificate {