1
0
Fork 0

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
1 changed files with 6 additions and 2 deletions

View File

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