Linux CA Management with update-ca-trust

In enterprise Linux environments, establishing trust for internal services, private PKI, and secure web communications requires centralized management of Certificate Authorities (CAs). Distributions such as Red Hat Enterprise Linux (RHEL), CentOS, Fedora, and Rocky Linux implement the update-ca-trust framework to manage this process. This article explains the mechanics of the shared system certificates storage, how the update-ca-trust command integrates custom certificates into the central trust store, and how various cryptographic libraries access these compiled certificates.

The Shared System Certificates Architecture

Modern Linux distributions consolidate CA certificates into a unified trust store rather than requiring each application to maintain its own bundle. This centralized system relies on a specific directory hierarchy under /etc/pki/ca-trust/ and /usr/share/pki/ca-trust-source/:

How update-ca-trust Works

The update-ca-trust tool acts as a build script. When invoked, it evaluates the trust configuration, scans the source directories, and converts the individual certificates into standardized output formats for various cryptographic engines.

1. Merging and Precedence

The tool reads the base system certificates and merges them with the local certificates stored in /etc/pki/ca-trust/source/anchors/. If a certificate is located in /etc/pki/ca-trust/source/blacklist/, update-ca-trust marks it as explicitly distrusted, overriding any system defaults.

2. Output Generation

Different software suites on Linux use different cryptographic libraries, such as OpenSSL, GnuTLS, and Java. To provide consistency across all tools, update-ca-trust extract builds multiple bundled formats within /etc/pki/ca-trust/extracted/:

The operating system manages symlinks from classic locations (such as /etc/ssl/certs/ca-bundle.crt or /etc/pki/tls/cert.pem) directly to these generated files, ensuring backward compatibility with legacy applications.

Managing Certificates with update-ca-trust

Managing CA certificates involves a simple three-step lifecycle:

Adding a New Certificate

To add an enterprise or self-signed Root CA to the system-wide store:

  1. Convert the certificate to PEM or DER format (typically with a .crt extension).
  2. Copy the file into the administrator anchors directory:
    cp my-custom-ca.crt /etc/pki/ca-trust/source/anchors/
  3. Update the compiled trust store:
    update-ca-trust extract

Removing a Certificate

To revoke trust for a custom CA added previously:

  1. Delete the certificate file from /etc/pki/ca-trust/source/anchors/.
  2. Regenerate the system bundles:
    update-ca-trust extract

Explicit Distrust

If a built-in upstream certificate needs to be disabled without removing OS-level packages:

  1. Place the certificate into /etc/pki/ca-trust/source/blacklist/.
  2. Run update-ca-trust extract.

Running update-ca-trust ensures that all low-level trust databases are synchronized simultaneously, eliminating the need to configure separate certificate stores for individual runtimes and tools.