Skip to main content
TLS certificates are required when the governance server binds to a non-loopback address (anything outside 127.x.x.x). For local multi-process development on loopback, no certs are needed.

Commands

generate

Generate a complete certificate bundle for the governance server.
Always generates all five files atomically — PKI requires a CA to sign the server and client certs, so partial generation is not supported.

Files generated

nanny server start reads server.crt, server.key, and ca.crt automatically. Agents on other machines need client.crt, client.key, and ca.crt.

Flags

Example output

If cert files already exist


import

Import externally-issued certificates. Use this when your organization has its own PKI (HashiCorp Vault, AWS ACM, cert-manager, an internal CA).
Takes key=value pairs. Values are either a PEM string or a @file reference (path prefixed with @). Three keys are accepted: ca, cert, key. Partial imports are supported. Omit any key to leave the existing file unchanged. This is useful for rotating only the server cert and key while keeping the existing CA:
After any import, Nanny validates that the certificate is signed by the CA (imported or existing). A mismatched cert/CA pair fails loudly with a clear error before any file is written.

Examples

From files:
From environment variables (Vault Agent, CI/CD injection):
Directly from Vault CLI (no temp files):
Updating CA, cert, and key together (CA was replaced by external PKI):
After a successful import, if the governance server is running, it hot-reloads the new certs automatically. No restart needed.

rotate

Regenerate the server and client certificates, preserving the existing CA.
rotate signs new server and client certs using the CA that nanny certs generate created. The CA itself is not changed — existing agents that trust this CA continue to work without re-importing ca.crt. When to use rotate:
  • Cert expiry is approaching (check with nanny certs show)
  • You want to invalidate the existing client cert (rotation generates a new client.crt + client.key)
When rotate does not apply:
  • Your certs were issued by an external PKI (Vault, AWS ACM, etc.) — those systems hold the CA private key, not Nanny. Use nanny certs import instead.
rotate requires ca.key to be present in ~/.nanny/certs/. This file only exists when nanny certs generate created the CA. If ca.key is missing, rotate exits with an error and suggests nanny certs import.

Example output


show

Show expiry dates, file inventory, and SAN list for the current cert bundle.
Does not print private key material or file paths. Status only.

Example output

If no certs exist:

remove

Delete all cert files from ~/.nanny/certs/.
Prompts for confirmation before deleting. After removal, nanny server start with a non-loopback address will refuse to start until new certs are generated or imported. If no certs exist:

Certificate hot-reload

The governance server watches ~/.nanny/certs/ for file changes. When cert files are updated — by nanny certs import, nanny certs rotate, or an external PKI agent writing to the directory — the server reloads the new certs without restarting. New connections use the new cert immediately; existing connections complete on the old cert. This is designed for short-lived PKI certs (for example, Vault PKI secrets engine issuing 8-hour certs renewed automatically by Vault Agent). The server stays up; certs rotate underneath it.

Keeping ca.key secure

The CA private key (ca.key) is the trust anchor for your entire certificate bundle. Anyone with access to ca.key can generate new certificates that your server will accept.
  • Keep ca.key on the server machine only. Never copy it to agent machines.
  • The client machines need only ca.crt (to verify the server) and client.crt + client.key (to present to the server).
  • Back up ca.key securely. If you lose it, run nanny certs generate --force to start fresh — but you will need to redistribute ca.crt to all agent machines.