Skip to content

nkapp certs ​

Read-only TLS (Transport Layer Security) certificate inspection — CLI parity for the Hub Certificates view. The CLI, the bridge and the Hub all go through the same code path (gateway Caddy storage read + a live :443 probe), so they can never disagree.

bash
nkapp certs <subcommand> [options]

Subcommands ​

certs list ​

List the environment's TLS certificates: the gateway's Caddy certificate storage (a single read-only docker exec that globs *.crt files only) merged with a live :443 probe of the environment's configured public hosts.

Usage:

bash
nkapp certs list [-e <env>] [--json]

Output: columns HOST · STATUS · EXPIRES · SOURCE · ISSUER, plus a ⚠ warning line per certificate when one exists. The header always carries the honest storage verdict — storage: readable (n stored chain(s)) or storage: not readable — <reason> — so a cloud environment without readable storage shows live-probe data only instead of failing.

An empty list exits 0 with an explainer: local/docker environments have no public certificates, and remote environments need a running gateway plus public host: entries in nanokit.yml.

certs show <host> ​

Show one host's full certificate record.

Usage:

bash
nkapp certs show <host> [-e <env>] [--json]

Fields: status (+ days remaining), valid from/until, subject, issuer (+ kind public/internal/unknown), SAN (Subject Alternative Name), serial, SHA-256 fingerprint, storage path, source, last-checked time — and, under --json, the public chain itself as PEM (Privacy-Enhanced Mail).

An unknown host prints a hint ("only PUBLIC hosts appear here; check nanokit.yml host: entries") and exits 1 in both output shapes.

Flags ​

FlagTypeDefaultDescription
-e, --env <env>stringthe config's activeEnv, falling back to localEnvironment to inspect.
--jsonbooleanoffMachine-readable JSON on stdout (the banner is suppressed so stdout stays pipeable).

Examples:

bash
nkapp certs list -e production
nkapp certs list -e production --json | jq '.certs[] | {host,status,daysRemaining}'
nkapp certs show app.example.com -e production
nkapp certs show app.example.com --json

Status vocabulary ​

StatusMeaning
validPresent, public and not expiring.
expiring-soonExpires in ≤ 7 days.
expiredPast its expiry date.
not-yet-issuedPublic host but no cert yet (ACME — Automatic Certificate Management Environment — never completed).
missingNothing presented on :443.
unreachableThe probe could not connect.
not-managedTLS is terminated outside a Nanokit gateway (gcp, digitalocean, cloudflare, azure) — printed with the mandated copy "TLS non gestito da Nanokit per questo provider". No renewal is promised for these providers.

What this command deliberately does NOT do ​

  • No certs renew. Renewal is Hub-only: the Hub's Renew action sends a CERT_ACTION {renew} over the local bridge, which recycles the environment's gateway so Caddy re-issues the certificates (environment-wide, with an explicit confirmation). No per-host re-issue, no revoke, and no write path to the gateway storage exist in v1.
  • The private key never leaves the gateway. The storage dump globs *.crt only — .key files are never read — and both the CLI footer and the Hub dialog state "Public chain only — the private key never leaves the gateway".

See specs/CERTIFICATES.md in the repository for the full design (decisions D1–D7).