Browse Source

Fix typo in error message and comment

Mariano Cano 2 năm trước cách đây
mục cha
commit
0ac9023590
2 tập tin đã thay đổi với 5 bổ sung và 2 xóa
  1. 4 1
      authority/tls.go
  2. 1 1
      cas/stepcas/stepcas.go

+ 4 - 1
authority/tls.go

@@ -913,7 +913,10 @@ func (a *Authority) GetTLSCertificate() (*tls.Certificate, error) {
 		return fatal(err)
 	}
 
-	// For StepCAS RA let the lifetime to the provisioner used by the CA.
+	// Set the cert lifetime as follows:
+	//   i) If the CA is not a StepCAS RA use 24h, else
+	//  ii) if the CA is a StepCAS RA, leave the lifetime empty and
+	//      let the provisioner of the CA decide the lifetime of the RA cert.
 	var lifetime time.Duration
 	if casapi.TypeOf(a.x509CAService) != casapi.StepCAS {
 		lifetime = 24 * time.Hour

+ 1 - 1
cas/stepcas/stepcas.go

@@ -79,7 +79,7 @@ func (s *StepCAS) CreateCertificate(req *apiv1.CreateCertificateRequest) (*apiv1
 	case req.Template == nil:
 		return nil, errors.New("createCertificateRequest `template` cannot be nil")
 	case req.Lifetime < 0:
-		return nil, errors.New("createCertificateRequest `lifetime` cannot less than 0")
+		return nil, errors.New("createCertificateRequest `lifetime` cannot be less than 0")
 	}
 
 	info := &raInfo{