delete_ca

This script will delete the certificate authority.

The certificate authority will be deleted from the following location:

Linux
  1. $EASYRSA_PKI (if set)

  2. $XDG_DATA_HOME/easyrsa/pki (if $XDG_DATA_HOME is set)

  3. $HOME/.easyrsa/pki

macOS
  1. $EASYRSA_PKI (if set)

  2. $XDG_DATA_HOME/easyrsa/pki (if $XDG_DATA_HOME is set)

  3. $HOME/Library/Application Support/easyrsa/pki

Chrome, Firefox, and Safari need no further configuration—​you should restart your browser though.

Docker needs to be restarted.

On CentOS, Debian, Fedora, Mint, Red Hat, and Ubuntu you need to remove the CA root certificate from your trust store manually.

On macOS, you need to remove the CA root certificate from your "System" keychain in Keychain Access manually.

Copy the script into your Node.js project and add it as a custom script to your package.json file:

package.json
{
...
  "scripts": {
    "cert:ca:delete": "scripts/delete_ca.sh"
  }
}
$ npm run cert:ca:delete

Usage

$ ./delete_ca.sh

WARNING: You are about to delete the CA 'Easy-RSA CA (2024-08-05, example-host)':

/Users/example/.local/secrets/easyrsa/pki/
ca.crt
certs_by_serial/
index.txt
index.txt.attr
inline/
issued/
openssl-easyrsa.cnf
private/
reqs/
revoked/
serial
vars

All existing certificates based on this CA will become invalid.

Do you really want to irreversibly delete the CA (Y/N)? y

Please delete the 'Easy-RSA CA (2024-08-05, example-host)' certificate from your System keychain.

Also, please consult your browser's documentation on how to remove the CA certificate.

Prerequisites