How to distrust a root CA on Linux (Debian, Ubuntu, RHEL, Arch)

December 2, 2026

Most Linux how-tos for CA certificates explain how to add a private corporate root. This post is the other job: stop trusting a root the distribution already shipped, after a public distrust or an internal policy.

The system store is only one store. Firefox, Java, certifi, and (on Linux) Chrome’s NSS database are separate. A change here does not update those clients. For a hostname-limited copy of a PEM bundle, see A limited PEM bundle for a few hostnames. Prefer a temporary file or a container while you are learning; do not point experiments at live /etc or /usr CA paths.

The system store is not the only store

On Linux, programs that use the operating system’s CA bundle typically read a file generated from a CA directory — /etc/ssl/certs/ca-certificates.crt on Debian and Ubuntu, or the tls-ca-bundle.pem that update-ca-trust writes on RHEL, Fedora, and Arch. Browsers, language runtimes, and some language packages often keep their own lists:

  • Firefox uses an NSS profile under ~/.mozilla/firefox (or $XDG_CONFIG_HOME/mozilla/firefox).
  • Java uses cacerts under JAVA_HOME.
  • Python certifi uses its own cacert.pem (a distro-patched certifi may point at the system bundle).
  • Chrome on Linux can use an NSS database at ~/.pki/nssdb.

Platforms has discovery paths and support levels. Do not assume a system allowlist has updated every client.

The Debian/Ubuntu mechanism and the RHEL/Arch mechanism are not interchangeable. Do not copy a blocklist path from one family onto the other, and do not hand-edit the generated bundle (ca-certificates.crt or tls-ca-bundle.pem). That file is output; the next refresh will rebuild it.

Where each family keeps CA trust

Debian, Ubuntu, and the update-ca-certificates layout

Debian and Ubuntu (Alpine and Gentoo use a similar layout) ship CA files under /usr/share/ca-certificates. Local additions go in /usr/local/share/ca-certificates. /etc/ca-certificates.conf lists which shipped certificates are enabled. update-ca-certificates(8) reads that file, installs the selected certificates into /etc/ssl/certs, and writes the concatenated bundle /etc/ssl/certs/ca-certificates.crt.

To disable a CA you did not add — a root the ca-certificates package shipped — the documented interface is the configuration file, not the generated bundle. Prefix the certificate’s path with ! in /etc/ca-certificates.conf, or run sudo dpkg-reconfigure ca-certificates and deselect it, then run sudo update-ca-certificates. Lines beginning with ! deselect and deactivate that CA. README.Debian describes the same dpkg-reconfigure flow.

A package update can put a shipped certificate back into play if configuration is reset or a new file is enabled. There is no guarantee a distrust survives the next ca-certificates upgrade.

Fedora, RHEL, and Rocky (update-ca-trust, source/blocklist)

RHEL, Fedora, CentOS, and Rocky use the p11-kit system-wide trust store. Red Hat’s RHEL 9 documentation places trust anchors in /etc/pki/ca-trust/source/anchors/ (or the lower-priority /usr/share/pki/ca-trust-source/anchors/) and distrusted certificates in /etc/pki/ca-trust/source/blocklist/ (or /usr/share/pki/ca-trust-source/blocklist/). Settings under /etc/pki/ca-trust/ take priority over /usr/share/pki/ca-trust-source/. After a change, run update-ca-trust (or update-ca-trust extract). The extracted TLS bundle is /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem.

The same document describes the trust command from p11-kit: trust list lists anchors and certificates; trust anchor /path/to/certificate.crt stores an anchor; trust anchor --remove removes one by path or PKCS#11 id. Putting a PEM in the blocklist directory is the layout for distrusting a certificate; trust anchor --remove is the documented way to remove an anchor you added. They are not the same operation.

Do not edit files under extracted/. update-ca-trust regenerates them.

Arch (update-ca-trust, /etc/ca-certificates/trust-source/blocklist)

Arch uses the same p11-kit model with different paths. update-ca-trust(8) and the ArchWiki TLS page put high-priority sources under /etc/ca-certificates/trust-source/: anchors in anchors/, distrust in blocklist/. Lower-priority packaged sources live under /usr/share/ca-certificates/trust-source/. The extracted bundle is /etc/ca-certificates/extracted/tls-ca-bundle.pem. After changing a trust-source directory, run update-ca-trust or update-ca-trust extract. Certificates in the system blocklist/ directory are treated as distrusted for all purposes.

The trust utility is available here too (trust list, trust anchor). The Debian update-ca-certificates command and /etc/ca-certificates.conf are not this layout.

trustprune picks the first CA directory whose bundle file exists, in this order: Fedora/RHEL/Rocky, then Arch, then Debian/Ubuntu/Alpine/Gentoo. Fedora and Arch often also ship /etc/ssl/certs/ca-certificates.crt as a compatibility symlink, which is why the unique bundle paths are checked first. Details are in Platforms.

Audit the current store

Install current trustprune (v1.0.0) if you want one CLI for this; see Install. Basics and Usage cover the commands. Listing does not change the store.

trustprune apps
trustprune list --count
trustprune list

On p11-kit systems you can also run trust list. On Debian and Ubuntu, /etc/ca-certificates.conf is the enabled-set. Neither is a complete view of Firefox, Java, or certifi.

On Windows, the platform store is list-only: allowlist and backup do not write to it. That does not apply to the Linux platform store, which supports those operations.

Distrust a root without hand-editing the bundle

Backup first

Allowlisting refuses to write if the store has no backup (Backup and restore). Linux platform backups are a mirror of the live CA directory under ~/.trustprune/linux/<timestamp>/.

trustprune backup --dry-run
trustprune backup

Refresh tools (update-ca-certificates or update-ca-trust) and copies into root-owned paths escalate with sudo when sudo is on PATH, otherwise su. A process that is already root runs the command directly. Exact behavior is on Platforms.

--dry-run, then allowlist

An allowlist is a list of SHA-256 fingerprints to keep (Allowlists). Preview, then apply:

trustprune allowlist --file allowlist.yaml --dry-run
trustprune allowlist --file allowlist.yaml

On Fedora, RHEL, Rocky, and Arch, allowlist writes distrust PEM overlays into the distro blocklist directory and runs update-ca-trust, so the extracted bundle is rebuilt from trust-source. On Debian and Ubuntu, it updates files under the CA directory and runs update-ca-certificates. That is not a substitute for editing /etc/ca-certificates.conf by hand; it is the tool’s Debian-style remove path. A later package upgrade can restore vendor files. Do not assume the change survives the next OS or ca-certificates update.

--dry-run prints the plan and does not write. There is no complete coverage of every CA that might appear in some other store on the machine.

Verify

A changed --count or a successful connect is not proof that the intended CA was distrusted. If the allowlist kept the target root and removed a different one, the count can still drop and a site can still connect. Record the target’s SHA-256 before you apply the allowlist, then confirm it is absent from the resulting store:

trustprune list -v
trustprune list --count
trustprune connect https://example.com

-v / --verbose prints the full fingerprint in the table. connect uses the platform store unless you pass --app; it only tells you whether a given hostname still works.

Roll back

Use restore only when you want the previous store back. Linux restore stages the backup into a sibling temporary directory, swaps it into place, and runs the distro refresh command. If refresh fails, it puts the previous tree back. The step-by-step swap is in Backup and restore.

trustprune restore --dry-run
trustprune restore

A Linux platform backup is a mirror of the live CA directory (/usr/share/ca-certificates on Debian and Ubuntu, /etc/pki/ca-trust/source on Fedora, RHEL, and Rocky, or /etc/ca-certificates/trust-source on Arch). It does not include /etc/ca-certificates.conf. If you disabled a CA with a ! prefix in that file or with dpkg-reconfigure ca-certificates, trustprune restore does not undo that change. To re-enable the CA, remove the ! prefix from the certificate’s line in /etc/ca-certificates.conf, or reselect it with sudo dpkg-reconfigure ca-certificates, then run sudo update-ca-certificates.

What this does not change

A system-store allowlist does not update Firefox, Chrome’s Linux NSS database, Java cacerts, or Python certifi. Use --app firefox, --app chrome, --app java, or --app certifi for those stores when they are supported. Platforms is the support table.

The same split exists on macOS: Safari follows Apple’s frameworks and Keychain, while git and curl read /etc/ssl/cert.pem. See Why Safari blocked that CA but git and curl still trust it.

Experiment on a copy or in a container, not on /etc

To practice on a PEM copy rather than the live system store, use --app openssl --bundle as in the 11 November post. Pointing allowlist at the real CA directory is a privileged change. Back up first, and keep a known-good backup until the machine still reaches the sites and tools you need.

Changing CA trust stores can break TLS, cut off access and reduce security, so back up first and proceed at your own risk. trustprune is provided as is, with no warranty, under the Apache License 2.0, and its authors and contributors accept no liability.

← Blog


Changing CA trust stores can break TLS, cut off access and reduce security, so back up first and proceed at your own risk. trustprune is provided as is, with no warranty, under the Apache License 2.0, and its authors and contributors accept no liability.

This site uses Just the Docs, a documentation theme for Jekyll.