Public certificate authorities (CAs) are the right choice for anything on the public internet. For everything else (internal tools, databases, service-to-service traffic, devices, client certificates), most organisations end up running their own private PKI: a certificate authority that only their own systems trust.
This guide covers when you need one, how to design it, three practical ways to build it (OpenSSL, step-ca and HashiCorp Vault), how to get devices to trust it, and how to keep it healthy for years.
When you need a private CA
- Internal names. Public CAs can only issue for domains that resolve publicly.
jenkins.corp,db01.internaland bare hostnames need a private CA. - Names you don't want published. Every public certificate is recorded in public Certificate Transparency logs, so anyone can list your hostnames on crt.sh. Private certificates aren't logged.
- Client certificates and mTLS. Public CAs have stopped issuing certificates for client authentication: Let's Encrypt issued its last on 8 July 2026, following a Chrome root program requirement to separate server and client certificates. A private CA is now the standard way to do mutual TLS.
- Devices and appliances that can't run ACME against a public CA, or need longer-lived certificates than public rules allow.
- Your own rules. Public certificates are limited to 200 days now, 100 days from March 2027 and 47 days from 2029. A private CA sets its own lifetimes, though short is still better.
Design first: the two-tier hierarchy
Almost every private PKI should have two tiers:
Root CA (offline, 10–20 years)
└─ Issuing CA (online, 3–5 years)
├─ api.internal (days to 90 days)
├─ db01.internal
└─ client: payments-service
- The root CA signs only intermediate certificates. Its private key stays offline: on an encrypted USB drive in a safe, or in a hardware security module (HSM) that's disconnected when not in use. You use it once every few years.
- The issuing (intermediate) CA signs everyday certificates and runs online, ideally behind an HSM or a cloud key service. If it's compromised, you revoke it with the root and create a new one, without having to redistribute trust to every device.
Decisions to make up front
| Decision | Recommendation |
|---|---|
| Key algorithm | ECDSA P-384 for the root, P-256 for issuing CA and leaves; RSA 3072+ only where old clients need it |
| Root lifetime | 10–20 years, with a written plan for replacing it |
| Issuing CA lifetime | 3–5 years, renewed well before it expires |
| Leaf lifetime | As short as your automation allows: 24 hours to 90 days |
| Name constraints | Limit the issuing CA to your own domains (for example .internal and example.com), so a stolen key can't sign google.com |
| Path length | pathlen:0 on the issuing CA, so it can't create further CAs |
| Naming | Use a domain you own, or .internal, which ICANN has reserved for private use. Avoid made-up TLDs that might become public |
| Revocation | Publish a CRL for the issuing CA; with very short-lived leaves you can skip OCSP |
Name constraints are the most overlooked line in that table. Without them, any device that trusts your root will accept a certificate from it for any website. With them, a compromise is limited to your own names.
Option 1: OpenSSL, for learning and small setups
OpenSSL can build the whole hierarchy with a few commands. It's good for understanding how things fit together and for a small lab, but it has no automation, so every renewal is manual.
Create the root (keep root.key offline afterwards):
openssl req -x509 -new -newkey ec -pkeyopt ec_paramgen_curve:P-384 \
-keyout root.key -out root.crt -days 7300 \
-subj "/O=Example Ltd/CN=Example Root CA" \
-addext "basicConstraints=critical,CA:TRUE" \
-addext "keyUsage=critical,keyCertSign,cRLSign"
Create the issuing CA, with name constraints, and sign it with the root:
openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:P-256 \
-keyout issuing.key -out issuing.csr -subj "/O=Example Ltd/CN=Example Issuing CA 1"
openssl x509 -req -in issuing.csr -CA root.crt -CAkey root.key -out issuing.crt -days 1825 \
-extfile <(printf '%s\n' \
"basicConstraints=critical,CA:TRUE,pathlen:0" \
"keyUsage=critical,keyCertSign,cRLSign" \
"nameConstraints=critical,permitted;DNS:.internal,permitted;DNS:example.com,permitted;DNS:.example.com")
Issue a server certificate:
openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes \
-keyout api.key -out api.csr -subj "/CN=api.internal"
openssl x509 -req -in api.csr -CA issuing.crt -CAkey issuing.key -out api.crt -days 90 \
-extfile <(printf '%s\n' "subjectAltName=DNS:api.internal" \
"extendedKeyUsage=serverAuth" "keyUsage=critical,digitalSignature")
cat api.crt issuing.crt > api-fullchain.crt # servers send the leaf and the issuing CA
openssl verify -CAfile root.crt -untrusted issuing.crt api.crt
Once you have more than a handful of certificates, move to one of the options below.
Option 2: step-ca, for ACME on your own network
step-ca from Smallstep is an open-source online CA that speaks ACME, the same protocol Let's Encrypt uses. That means Certbot, cert-manager, Caddy and Traefik can get and renew internal certificates exactly as they would public ones.
# Creates a root and an issuing CA, and the CA's configuration
step ca init --deployment-type standalone --name "Example Internal CA" \
--dns ca.internal --address :443 --provisioner admin@example.com
# Let ACME clients request certificates
step ca provisioner add acme --type ACME
Clients then point at the CA's ACME directory, for example with Certbot:
sudo REQUESTS_CA_BUNDLE=/etc/ssl/certs/example-root.pem certbot certonly --standalone \
--server https://ca.internal/acme/acme/directory -d api.internal
By default step-ca issues certificates valid for 24 hours, so renewal has to be fully automatic from day one. That's a feature: with lifetimes that short, a leaked key expires before anyone can do much with it. After setup, move the root key off the CA server.
Option 3: HashiCorp Vault PKI, for platforms already on Vault
If your applications already get secrets from Vault, its PKI secrets engine can issue certificates through the same API and policies. A typical setup keeps the root in one mount (or offline) and issues from an intermediate mount:
vault secrets enable -path=pki_int pki
vault secrets tune -max-lease-ttl=43800h pki_int
# Generate the intermediate's CSR, sign it with your root, then import the result
vault write -field=csr pki_int/intermediate/generate/internal \
common_name="Example Issuing CA 2" > pki_int.csr
vault write pki_int/intermediate/set-signed certificate=@pki_int.crt
# A role limits what can be issued
vault write pki_int/roles/internal-services \
allowed_domains="internal" allow_subdomains=true max_ttl=720h
# An application (with a policy allowing it) asks for a certificate
vault write pki_int/issue/internal-services common_name="api.internal" ttl=72h
Vault Agent or the Vault CSI provider can then write certificates to disk and renew them, and recent Vault versions can also act as an ACME server.
Which one?
| OpenSSL | step-ca | Vault PKI | |
|---|---|---|---|
| Best for | Labs, a few long-lived certificates | Teams that want ACME internally | Platforms already using Vault |
| Automation | None built in | ACME, plus its own CLI and renewal daemon | API, Vault Agent, ACME |
| Default leaf lifetime | Whatever you type | 24 hours | Set per role |
| Running cost | None | One small service | Vault cluster (you may already have one) |
Managed services such as AWS Private CA, Google Certificate Authority Service and Azure-integrated options do the same job without running the CA yourself, at a monthly price per CA.
Distributing trust
A private CA is only useful once every client trusts its root. Make this part of your build images and device management, not a manual step:
| Where | How |
|---|---|
| Debian, Ubuntu | Copy the root to /usr/local/share/ca-certificates/example-root.crt, run update-ca-certificates |
| RHEL, Fedora, Amazon Linux | Copy to /etc/pki/ca-trust/source/anchors/, run update-ca-trust |
| Windows | Group Policy or Intune: Trusted Root Certification Authorities |
| macOS, iOS | Configuration profile from your MDM |
| Java | keytool -importcert -cacerts -alias example-root -file root.crt (per Java installation) |
| Node.js | NODE_EXTRA_CA_CERTS=/path/to/root.crt |
Python requests |
Uses its own bundle: set REQUESTS_CA_BUNDLE or SSL_CERT_FILE |
| Containers | Add the root in the base image, then run the distribution's update command |
| Firefox | Enterprise policy ImportEnterpriseRoots or Certificates |
The runtimes that keep their own trust store (Java, Python, Firefox, many appliances) are where "it works in the browser but not in the app" problems come from.
Protecting the keys
The eMudhra incident in October 2026 showed what happens when CA keys are weak: anyone could have issued certificates under them. For a private CA the stakes are lower but similar: whoever holds the issuing key can impersonate any internal service.
- Root key offline. Generate it on an offline machine or HSM, back it up encrypted in two places, and write down who can use it and how.
- Issuing key in hardware where possible. An HSM, a YubiHSM or a cloud key service (AWS KMS, Google Cloud KMS, Azure Key Vault) means the key can't be copied off the server.
- Limit who can request what. Use step-ca provisioners or Vault roles so a service can only get certificates for its own names.
- Log every issuance, and review the log. Private CAs have no public Certificate Transparency to catch mistakes for you.
Rotation: plan it before you need it
- Leaf certificates should renew automatically, at about two-thirds of their lifetime.
- The issuing CA needs replacing every few years. Create the new one, start issuing from it, and keep the old one valid until every certificate it signed has expired. Clients don't need changes, because both chain to the same root.
- The root is the hard one. Distribute the new root to every client long before you need it, ideally years ahead, then move issuing CAs under it. A root that expires before its replacement is everywhere breaks every internal connection at once.
Put each CA's expiry date in a calendar, a runbook and your monitoring. A CA certificate created "for 10 years" is exactly the kind of thing nobody remembers when the day comes.
Monitoring a private PKI
Public monitoring tools can't see internal certificates, and private certificates aren't in Certificate Transparency logs, so nobody outside will notice when they expire. You need to:
- Inventory what's been issued and where it's installed.
- Check what each service actually serves, from inside the network: the right certificate, a complete chain, not expiring.
- Watch the CA certificates themselves, root and issuing, which expire too.
CertHalo does this on the Business plan: you upload your private root CAs, and open-source CertHalo agents check your internal hosts from inside the network, including databases, mail and LDAP servers, and report each certificate's expiry, chain and trust. Alerts go to email, Slack, Microsoft Teams or a webhook. See why internal certificates need watching, or start free.
Key takeaways
- Use a private CA for internal names, client certificates and mTLS, and devices. Public CAs no longer issue client-authentication certificates.
- Build two tiers: an offline root and an online issuing CA, with name constraints and
pathlen:0. - OpenSSL for learning, step-ca for ACME on your network, Vault if you already run it.
- Distribute the root everywhere, including runtimes with their own trust stores.
- Keep leaf certificates short-lived and automatic, and plan root and issuing CA rotation years ahead.
Sources
- Smallstep: step-ca documentation and configuration
- HashiCorp: Vault PKI secrets engine
- Let's Encrypt: Ending TLS client authentication certificate support
- ICANN: .internal reserved for private use
- IETF: RFC 5280, X.509 certificate profile (name constraints, section 4.2.1.10)