Like the other answers say, openssl CA usually keeps a copy of signed certificates in a subdirectory (newcerts
or certs
, or keys
with easyrsa. Look for new_certs_dir
definition in the openssl.cnf file of your authority or -outdir
option in the scripts).
Thus, the canonical way of doing is something along :
openssl ca -config openssl.cnf -revoke newcerts/hello-world.pem
However, I add this answer to note that, with current versions, openssl ca -revoke ...
seems to only update the index.txt
file (it will nevertheless ask for the private key password, which is questioned there) so if you really don't have any certificate backup but still have the index.txt
or some way to retrieve the serial number, you can look up / make up the certificate line and change it :
# before
V 291008172120Z 6DB67443D7E6C2D95D6E2F7F264C05F944964049 unknown /C=FR/CN=coucou.com
# after
R 291008172120Z 191011172218Z 6DB67443D7E6C2D95D6E2F7F264C05F944964049 unknown /C=FR/CN=coucou.com
# Format is 6 fields, tab-separated, and filename is usually 'unknown' :
# CRL doesn't contain nor need the subject so if unavailable, just make up something close
V/R/E expiration-date revocation-date serial-number filename subject
(tested with OpenSSL 1.1.1c. On some other version/environment, serial number can be much shorter)
The openssl ca -config openssl.cnf -gencrl -crldays 30 -out crl.pem
will be the actual step to revoke the certificate, producing a signed list using the private key of the authority.