Home Cert Authority -- simplified certificate authority for homelab HTTP use
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-08 19:59:14 +00:00
doc Add GPLv3 license, LLM note and screenshots to README 2026-11-08 05:00:37 -05:00
src/home_cert_authority Fix cert screen buttons; print to stdout without quitting the TUI 2026-11-08 04:55:25 -05:00
tests Fix cert screen buttons; print to stdout without quitting the TUI 2026-11-08 04:55:25 -05:00
.gitignore Build Home Cert Authority: Textual TUI and CLI for a home-lab CA 2026-11-08 04:39:31 -05:00
.python-version Build Home Cert Authority: Textual TUI and CLI for a home-lab CA 2026-11-08 04:39:31 -05:00
LICENSE Add GPLv3 license, LLM note and screenshots to README 2026-11-08 05:00:37 -05:00
pyproject.toml Add GPLv3 license, LLM note and screenshots to README 2026-11-08 05:00:37 -05:00
README.md Update README.md 2026-11-08 19:59:14 +00:00
uv.lock Build Home Cert Authority: Textual TUI and CLI for a home-lab CA 2026-11-08 04:39:31 -05:00

Home Cert Authority

A minimal, offline TLS certificate authority for a home lab, with a terminal UI built on Textual. It creates root CAs and HTTPS server certificates, imports and exports PEM, and generates a bash script that installs your root CA on Linux machines and browsers. See doc/requirements.md for the requirements it was built to.

This application was built with the help of an LLM agent.

Purpose

Why should you use this? Perhaps you shouldn't. The Let's Encrypt system provides a CA already trusted by every computer on the Internet, and they give out server certificates for free.

But Let's Encrypt can only issue a certificate for a server if you can prove to them that you own the server's hostname. You can answer this challenge by writing to the DNS zone that controls the hostname, or more commonly, by writing HTTP-accessible answer files on the target server.

If you want to use TLS with private resources, then you need a private CA because putting the DNS or hostname resolution into the public may be inconvenient for you, and of course if the server itself can answer HTTP on the public Internet, then it's not private.

HCA provides a quick and dirty alternative TUI to mucking about with openssl command line tools for:

  • Creating a private CA and associated private key
  • Creating a cert signed by your CA, and its associated private key

It doesn't handle any owner-generated metadata like organization or geographic address, nor does it speak on the network, sign certificate requests, or help you authenticate the target server. It's meant to be used in a homelab environment with few users, where everyone knows each other.

I created HCA as a TUI alternative to the CLI openssl tool and an alternative to the Linux GUI "XCA" application.

Every client will need to have your private certificate authority's root certificate installed and marked as trusted. See instructions below for Linux. For other client OS's, export the root CA cert and use those OS's normal means to install it in each client.

Is this a vibe-coded project? Is it secure?

That depends on your definition of vibe-coded. The human owner of the project is a senior software developer capable of managing projects properly.

This tool is as secure as the the Python cryptography core library combined with your information security processes. It is a thin wrapper around cryptographic primitives, to create keys, and sign messages attesting that a key belongs to a hostname.

HCA does not try to secure your key data at rest. That is your responsibility. I strongly recommend that you utilize one of the following approaches to protect HCA's data store while you are not in the process of creating and signing keys:

  • Store and run HCA in a separate, encrypted container or VM which is completely shut down and locked while you are not processing new certs.
  • Store HCA's data on a removeable USB drive and only plug it in when you are processing new certs. The removeable drive must be stored in a physically secure place, or encrypted.
  • Store HCA's data in an overlay encrypted filesystem such as fscrypt or gocryptfs or VeraCrypt, with the encrypted files locked while you are not processing new certs.

Install

Needs Python 3.11+ and uv.

uv tool install .          # installs the `hca` command (also `home-cert-authority`)
# or, from a checkout without installing:
uv run hca

Interactive UI

Run hca with no arguments.

  • Main list: one row per certificate. Server certificates are nested under the CA that signed them. The Key column shows whether the private key is in the store.
  • n new root CA · s new server certificate · i import · Enter open · d delete · q quit.
  • Certificate screen: shows the certificate and its private key together (a key always belongs to exactly one certificate). From here you can export the certificate, private key, full chain (server cert + issuer) or install script (CAs only), issue a server cert (CAs), attach a missing private key, or delete.

The certificate list: two root CAs, each with the server certificates it signed nested beneath it

The details screen of a wildcard server certificate, with its hostnames, issuer, validity, key and export buttons

Creating certificates

  • Root CA: give it a name, e.g. Smith Home Lab Root CA. Default lifetime is 10 years.
  • Server certificate: pick the signing CA and type one hostname. The Common Name and Subject Alternative Names are filled in from it, with a live preview:
Hostname Common Name Subject Alternative Names
nas.home.lan nas.home.lan DNS:nas.home.lan
*.home.lan *.home.lan DNS:*.home.lan, DNS:home.lan
192.168.1.10 192.168.1.10 IP:192.168.1.10

The default lifetime is 10 years or the time left on the signing CA, whichever is shorter. Every certificate gets a freshly generated key: ECDSA P-256 by default, with P-384, RSA 2048 and RSA 4096 also offered.

Export and import

  • Export writes PEM to a file, copies it to the terminal's clipboard, or prints it to standard output. The clipboard uses the OSC 52 escape sequence, so it works over SSH but your terminal must support it; some terminals (e.g. tmux, without set-clipboard on) block it. Print to standard output temporarily hands the terminal back to normal mode, prints the PEM so you can copy it from the scrollback, and returns to the app when you press a key. The UI draws on stderr and the prompt goes to the terminal, so with hca > root.crt only the PEM lands in the file.
  • Import reads PEM from a file path or pasted text. The input can hold certificates, private keys, or both. A private key is attached to the stored certificate it matches, so import the certificate first or together with its key. Encrypted keys prompt for a password.

Command line

The same operations are available as scripting-friendly commands. Here you can import from standard input and export to standard output.

hca list
hca show '*.home.lan'                         # by name, store id, or SHA-256 prefix
hca new-root 'Smith Home Lab Root CA'
hca new-server 'Smith Home Lab Root CA' '*.home.lan' [--days 825] [--key-type rsa-2048]
hca export '*.home.lan' > wildcard.crt         # certificate
hca export '*.home.lan' --chain -o fullchain.crt
hca export '*.home.lan' --key -o wildcard.key  # written with mode 0600
cat server.crt server.key | hca import         # from stdin (or: hca import FILE)
hca install-script 'Smith Home Lab Root CA' -o install-ca.sh

Root CA install script

Export install script (or hca install-script) writes a self-contained bash script with the CA certificate embedded in it. Copy it to a machine and run it as a normal user:

bash smith-home-lab-root-ca-install.sh               # system store + browsers
bash smith-home-lab-root-ca-install.sh --system-only
bash smith-home-lab-root-ca-install.sh --browsers-only
bash smith-home-lab-root-ca-install.sh --uninstall
  • System trust store (uses sudo): Debian/Ubuntu/Mint/Alpine (/usr/local/share/ca-certificates + update-ca-certificates), Fedora/RHEL (/etc/pki/ca-trust/source/anchors + update-ca-trust), Arch (/etc/ca-certificates/trust-source/anchors + update-ca-trust), openSUSE (/etc/pki/trust/anchors + update-ca-certificates).
  • Browsers (the current user's NSS databases, via certutil from libnss3-tools / nss-tools): Chromium, Chrome, Brave, Vivaldi, Edge (~/.pki/nssdb, created if missing), and every profile of Firefox, LibreWolf, Waterfox, Floorp, Zen and Mullvad Browser, including Snap and Flatpak installs. Restart the browsers afterwards.
  • The script prints the CA's SHA-256 fingerprint so recipients can check it with you.

Storage

Certificates and keys live in ~/.local/share/home-cert-authority (override with --data-dir or $HCA_DATA_DIR), one directory per certificate holding cert.pem and, when present, key.pem. Directories are mode 0700 and keys 0600. Private keys are not encrypted at rest, so protect that directory and back it up somewhere safe. Anyone who has your root CA key can impersonate any website to the machines that trust it.

Notes

  • Apple devices reject TLS server certificates valid for more than 825 days, even when they trust your root. If you use macOS or iOS clients, set the server certificate lifetime to 825 days or less (--days 825).
  • Out of scope: CSRs, revocation (CRL/OCSP), intermediate CA creation. Imported intermediate CAs are shown and can sign certificates.

Development

uv sync
uv run pytest

License

Copyright © 2026 Brendan Kidwell. Licensed under the GNU General Public License, version 3 or (at your option) any later version. See LICENSE.