forked from solderpunk/gemcert
Allow setting CN of client certs, for apps which use it for usenames.
This commit is contained in:
parent
4fd7d4d9be
commit
2357f81d67
8
main.go
8
main.go
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user