Trusting CA Certificates
A machine only trusts the certificates a CA issues once it trusts the CA’s root certificate. This page explains how to add a CA certificate to the trusted certificates of:
- The server certdog runs on, from within certdog
- A single Windows computer
- Every computer in a Windows domain
- A Linux machine
Trusting a root CA is a security decision: every certificate it issues will then be trusted. Only trust CAs your organisation runs or relies on.
Getting the CA certificate
- Certificate Issuers: choose the issuer, then Download PEM (the CA’s certificates, in one file) or click a certificate in its list to download it on its own (
.cer) - A CA certificate held in certdog (e.g. one that was imported): open its details, then Download > Certificate (.cer)
Both files are PEM (Base64) encoded, which every command below accepts.
The certificate to trust is the root: the CA certificate whose issuer is itself. Intermediate (issuing) CA certificates are not usually trusted directly: servers send them with their own certificate, or clients fetch them from the address in the certificate (AIA). On Windows they can be added to Intermediate Certification Authorities, which is never a trust decision.
From certdog (the server certdog runs on)
A global administrator can add a CA certificate to the trusted certificates of the server certdog runs on:
- Certificate Issuers: choose the issuer, then Trust on this server. This trusts the issuer’s CA certificates
- A CA certificate’s details: open the … (more actions) menu, then Trust on this server…
certdog does not check whether the certificate is already trusted. Adding it again changes nothing. Every request is recorded in the Logs, with who made it.
This changes the operating system’s trusted certificates, which browsers, PowerShell, agents and other software on that server use. It does not change the certificates certdog itself trusts for its own outgoing connections, which are held in certdog’s own trust store.
On Windows
certdog adds the certificates itself, to the Local Machine stores:
- A root CA certificate to Trusted Root Certification Authorities
- Any other CA certificate to Intermediate Certification Authorities
No prompt is shown. This needs the Krestfield Certdog Service to run as Local System (the default) or as an account in the server’s Administrators group. To check which account it runs as:
sc qc "Krestfield Certdog Service"
(SERVICE_START_NAME is LocalSystem by default.)
If the service runs as any other account (e.g. Network Service or a domain service account), Windows refuses the change. certdog then explains why and offers a PowerShell script to download. Run it on the server, from a PowerShell started with Run as administrator:
powershell -ExecutionPolicy Bypass -File .\trust-MyRootCA.ps1
This only changes the server certdog runs on. To trust the CA across your domain, see Every computer in a domain.
On Linux
certdog does not change the trusted certificates of a Linux server itself, as that needs root. Instead it downloads a script: copy it to the server and run it as root:
sudo sh trust-MyRootCA.sh
The script works out which Linux family it is running on and uses that family’s folder and command (see Linux). It adds the root of the issuer’s chain only, as any certificate added there is trusted as a root.
Windows: a single computer
Run one of these from an elevated command prompt or PowerShell (Run as administrator).
With certutil:
certutil -addstore -f Root rootca.cer
For an intermediate (issuing) CA certificate, use the CA store:
certutil -addstore -f CA issuingca.cer
Or with PowerShell:
Import-Certificate -FilePath .\rootca.cer -CertStoreLocation Cert:\LocalMachine\Root
Import-Certificate -FilePath .\issuingca.cer -CertStoreLocation Cert:\LocalMachine\CA
Or with the console: run certlm.msc, right-click Trusted Root Certification Authorities > Certificates, choose All Tasks > Import… and follow the wizard.
Always use the Local Machine stores (certlm.msc, Cert:\LocalMachine). Adding a root to the Current User store only affects that user, and Windows asks them to confirm it.
To remove it again (the thumbprint is shown in certdog’s certificate details):
certutil -delstore Root <thumbprint>
Windows: every computer in a domain
certdog never does this itself. There are two common ways.
Publish it to Active Directory
A member of Enterprise Admins (or Domain Admins of the forest root domain) runs:
certutil -dspublish -f rootca.cer RootCA
and for an intermediate CA certificate:
certutil -dspublish -f issuingca.cer SubCA
Every computer in the forest adds it to its Trusted Root Certification Authorities (or Intermediate Certification Authorities) store at its next Group Policy refresh. To pick it up straight away on a computer, run gpupdate /force or certutil -pulse. See Publishing CA Certs to Active Directory for an example.
Distribute it with Group Policy
Use this to trust the CA on only some computers (e.g. one OU or site), or where you manage trust through Group Policy:
- Run
gpmc.msc(Group Policy Management) as a domain administrator - Create a GPO linked to the domain or to the OU holding the computers (or edit an existing one)
- Edit it and go to Computer Configuration > Policies > Windows Settings > Security Settings > Public Key Policies
- Right-click Trusted Root Certification Authorities, choose Import… and select
rootca.cer - For an intermediate CA certificate, import it under Intermediate Certification Authorities instead
Computers apply it at their next Group Policy refresh, or straight away with gpupdate /force.
Computers that are not in a domain (or are managed by Intune or another tool) need it added with that tool, or one at a time as in A single computer.
Linux
Each Linux family keeps the extra CA certificates it trusts in a folder, and has a command that rebuilds the system’s list from it. Run these as root (e.g. with sudo). The file must be PEM (Base64) encoded.
| Family | Folder | Command |
|---|---|---|
| Debian, Ubuntu | /usr/local/share/ca-certificates/ (the file must end .crt) | update-ca-certificates |
| RHEL, CentOS, Rocky Linux, AlmaLinux, Oracle Linux, Fedora, Amazon Linux | /etc/pki/ca-trust/source/anchors/ | update-ca-trust extract |
| SUSE Linux Enterprise, openSUSE | /etc/pki/trust/anchors/ | update-ca-certificates |
| Alpine | /usr/local/share/ca-certificates/ (the file must end .crt) | update-ca-certificates |
| Arch Linux | (none needed) | trust anchor --store rootca.crt |
For example, on Ubuntu:
sudo cp rootca.cer /usr/local/share/ca-certificates/my-root-ca.crt
sudo update-ca-certificates
and on RHEL:
sudo cp rootca.cer /etc/pki/ca-trust/source/anchors/my-root-ca.crt
sudo update-ca-trust extract
If the command is missing, install the ca-certificates package first (e.g. apk add ca-certificates on Alpine).
To check that it is trusted, verify a certificate the CA issued against the system’s list:
openssl verify server.pem
To remove it again, delete the file from the folder and run the command again (on Debian and Ubuntu, update-ca-certificates --fresh).
Software with its own trusted certificates
Some software ignores the operating system’s list and keeps its own, so it needs the CA certificate as well. For example:
- Java:
keytool -importcert -cacerts -alias my-root-ca -file rootca.cer(as an administrator or root), or the trust store the application is configured with - Firefox: on Windows, set
security.enterprise_roots.enabled(or the Certificates > ImportEnterpriseRoots policy) so that it uses the Windows stores - Python (requests, certifi): set
REQUESTS_CA_BUNDLEto the system’s list (e.g./etc/ssl/certs/ca-certificates.crt) - Node.js: set
NODE_EXTRA_CA_CERTSto the CA certificate’s file