Expand description
Self-signed TLS support for --tls mode (Phase 1: no system trust
install). Generates a self-signed certificate for the configured
domain (with *.<domain> SAN) and persists it under
~/.config/fbi-proxy/certs/ so the same fingerprint survives
restarts — browsers can “remember the exception” once.
The browser warning is expected in this phase. Use Phase 2
(fbi-proxy trust) to install a local CA into the system trust
store for a clean lock-icon experience.
Functions§
- build_
acceptor - Build a
TlsAcceptorfor the given domain, reusing a persisted cert if one exists or generating + writing a fresh one if not. - cert_
pem_ path - Path to the cert file for a given domain (sibling
.keylives at the same stem). Use this when you need to install the cert into a system trust store afterbuild_acceptorhas materialized it. - default_
cert_ dir - Where on-disk certs live. Layout:
{base}/certs/{domain}.{pem,key}. - generate_
self_ signed - Generate a SAN-only self-signed cert valid for ~1 year. Returns
(cert_pem, key_pem). The Common Name is intentionally left blank — modern browsers ignore CN and only honor SAN entries. - install_
to_ system_ trust - Install
cert_pathas a trusted root anchor in the system trust store. Idempotent — checksis_trustedfirst and returnsOk(false)if no install was performed. - is_
trusted - Whether the given cert is currently a trusted anchor on this
system. Returns
falseif the check itself can’t be performed (unsupported platform, missing tool) — callers should treat that as “no, attempt install.”