Fixes to the documentation. Added missing --revoked logic for the list command.
Some checks failed
Release / release (push) Failing after 53s

This commit is contained in:
2025-12-10 21:33:23 +01:00
parent 714a38d612
commit affa895cfe
3 changed files with 20 additions and 12 deletions

14
ca.go
View File

@@ -460,9 +460,19 @@ func issueSingleCertificate(def CertificateDefinition, i int, n int) (bool, erro
return false, fmt.Errorf("certificate name must be specified and contain only letters, numbers, dash, or underscore")
}
// Check if the certificate is in database, fail if it is.
// Check if the certificate is in database, skip if it already exists and is valid.
if caState.FindByName(def.Name, false) != nil {
return false, fmt.Errorf("certificate %s already exists and is valid", def.Name)
if !dryRun {
fmt.Printf("skipped (already exists).\n")
} else {
msg := fmt.Sprintf("Certificate '%s' already exists and is valid (would skip).", def.Name)
if n > 1 {
fmt.Printf("[%d/%d] %s\n", i+1, n, msg)
} else {
fmt.Printf("%s\n", msg)
}
}
return false, nil
}
// Initialize Subject if not specified