diff --git a/authority/tls.go b/authority/tls.go index 25f14bf7..c7e2dd09 100644 --- a/authority/tls.go +++ b/authority/tls.go @@ -615,11 +615,11 @@ func (a *Authority) GetTLSCertificate() (*tls.Certificate, error) { certTpl.NotAfter = now.Add(24 * time.Hour) resp, err := a.x509CAService.CreateCertificate(&casapi.CreateCertificateRequest{ - Template: certTpl, - CSR: cr, - Lifetime: 24 * time.Hour, - Backdate: 1 * time.Minute, - IsServerCert: true, + Template: certTpl, + CSR: cr, + Lifetime: 24 * time.Hour, + Backdate: 1 * time.Minute, + IsCAServerCert: true, }) if err != nil { return fatal(err) diff --git a/cas/apiv1/requests.go b/cas/apiv1/requests.go index 49cb5cc3..d93cf38d 100644 --- a/cas/apiv1/requests.go +++ b/cas/apiv1/requests.go @@ -52,13 +52,13 @@ const ( // CreateCertificateRequest is the request used to sign a new certificate. type CreateCertificateRequest struct { - Template *x509.Certificate - CSR *x509.CertificateRequest - Lifetime time.Duration - Backdate time.Duration - RequestID string - Provisioner *ProvisionerInfo - IsServerCert bool + Template *x509.Certificate + CSR *x509.CertificateRequest + Lifetime time.Duration + Backdate time.Duration + RequestID string + Provisioner *ProvisionerInfo + IsCAServerCert bool } // ProvisionerInfo contains information of the provisioner used to authorize a diff --git a/cas/stepcas/stepcas.go b/cas/stepcas/stepcas.go index fb7a4941..f8770923 100644 --- a/cas/stepcas/stepcas.go +++ b/cas/stepcas/stepcas.go @@ -78,7 +78,7 @@ func (s *StepCAS) CreateCertificate(req *apiv1.CreateCertificateRequest) (*apiv1 info := &raInfo{ AuthorityID: s.authorityID, } - if req.IsServerCert { + if req.IsCAServerCert { info.EndpointID = newServerEndpointID(s.authorityID).String() } if p := req.Provisioner; p != nil { diff --git a/cas/stepcas/stepcas_test.go b/cas/stepcas/stepcas_test.go index 97750c81..cc8ea72e 100644 --- a/cas/stepcas/stepcas_test.go +++ b/cas/stepcas/stepcas_test.go @@ -673,9 +673,9 @@ func TestStepCAS_CreateCertificate(t *testing.T) { CertificateChain: []*x509.Certificate{testIssCrt}, }, false}, {"ok with server cert", fields{jwk, client, testRootFingerprint}, args{&apiv1.CreateCertificateRequest{ - CSR: testCR, - Lifetime: time.Hour, - IsServerCert: true, + CSR: testCR, + Lifetime: time.Hour, + IsCAServerCert: true, }}, &apiv1.CreateCertificateResponse{ Certificate: testCrt, CertificateChain: []*x509.Certificate{testIssCrt},