Fix ACME CSR generation

This commit is contained in:
James Munnelly 2018-03-23 16:14:41 +00:00
parent cb042e886f
commit e91dfc40af

View File

@ -28,10 +28,13 @@ const (
)
func (a *Acme) obtainCertificate(ctx context.Context, crt *v1alpha1.Certificate) ([]byte, []byte, error) {
commonName := crt.Spec.CommonName
altNames := crt.Spec.DNSNames
if len(commonName) == 0 && len(altNames) == 0 {
return nil, nil, fmt.Errorf("no domains specified on certificate")
commonName, err := pki.CommonNameForCertificate(crt)
if err != nil {
return nil, nil, err
}
altNames, err := pki.DNSNamesForCertificate(crt)
if err != nil {
return nil, nil, err
}
cl, err := a.acmeClient()