1
0
mirror of https://tildegit.org/solderpunk/gemcert synced 2024-11-23 00:32:08 +01:00

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

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