feat(tls): add --method ca for persistent local CA-signed leaves
Adds a new TLS certificate method ('ca') that generates a persistent local
Certificate Authority and signs leaf certificates against it. This allows
users to install the CA once on client devices and have browser-trusted
HTTPS for plain LAN names (my-host, 192.168.1.5, my-host.local) without
requiring external services like Tailscale.
Key improvements over existing --method selfsigned:
- Persistent CA: the root cert is stored separately and never rotates,
so leaf certificate renewal doesn't require re-trusting on clients
- Auto-detected SANs: includes LAN IP, tailnet name (if applicable),
hostname, and localhost variants
- Per-platform install guide: comprehensive docs/TRUSTING_THE_LOCAL_CA.md
with Windows PowerShell, macOS/Linux, iOS, and Android install steps
Solves PWA installation issues on Windows machines with corporate IT
policy blocking Tailscale: PWAs now persist in standalone mode when the
local CA is trusted in the Windows user cert store.
Changes:
- muxplex/tls.py: added _default_lan_ip(), _default_tailnet_name(),
generate_local_ca(), generate_leaf_signed_by_ca()
- muxplex/cli.py: added 'ca' to --method choices, wired setup_tls()
to generate CA + leaf with auto-detected SAN
- docs/TRUSTING_THE_LOCAL_CA.md: comprehensive per-platform install guide
- README.md: added --method ca documentation and cross-links
- CHANGELOG.md: documented v0.5.0 features
Generated with Amplifier
Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
This commit is contained in:
committed by
Brian Krabach
parent
abe6a97241
commit
33ea016f7e
@@ -67,10 +67,11 @@
|
||||
### HTTPS / TLS
|
||||
|
||||
- `muxplex setup-tls` — auto-detect and set up TLS certificates
|
||||
- **Tailscale** — real Let's Encrypt certs via `tailscale cert` (recommended)
|
||||
- **mkcert** — locally-trusted certs, zero browser warnings
|
||||
- **Tailscale** — real Let's Encrypt certs via `tailscale cert` (recommended when every client has Tailscale)
|
||||
- **mkcert** — locally-trusted certs, zero browser warnings (when mkcert is installed on each client)
|
||||
- **Local CA** — persistent root CA + signed leaf for browser-trusted HTTPS on plain LAN names (`spark-1`, `192.168.1.5`) without Tailscale or a public domain; install the CA once per client → see [Trusting the local CA](docs/TRUSTING_THE_LOCAL_CA.md)
|
||||
- **Self-signed** — fallback for immediate HTTPS (browser shows warning)
|
||||
- Required for browser clipboard API on non-localhost
|
||||
- Required for browser clipboard API on non-localhost, and for stable PWA install (browsers refuse to keep installed PWAs in standalone mode against an untrusted origin)
|
||||
|
||||
---
|
||||
|
||||
@@ -204,6 +205,7 @@ muxplex setup-tls
|
||||
muxplex setup-tls --method tailscale
|
||||
muxplex setup-tls --method mkcert
|
||||
muxplex setup-tls --method selfsigned
|
||||
muxplex setup-tls --method ca # persistent local CA + signed leaf
|
||||
|
||||
# Show current TLS status and configuration
|
||||
muxplex setup-tls --status
|
||||
@@ -219,6 +221,16 @@ Auto-detection priority: **Tailscale** (if `tailscale` is installed and a cert i
|
||||
|
||||
> **Note:** Tailscale certs have a 90-day expiry. Run `muxplex setup-tls --method tailscale` to renew when needed.
|
||||
|
||||
#### When to use `--method ca`
|
||||
|
||||
The `ca` method is for the case where you want browser-trusted HTTPS on plain LAN names (e.g. `https://my-host:8088`, `https://192.168.1.5:8088`) but **can't** use Tailscale (no client install, blocked by IT policy, or the URL must be the bare LAN name) and **don't** want to buy a public domain.
|
||||
|
||||
It generates a persistent root CA in `~/.config/muxplex/ca/` and signs a 13-month leaf with it. The leaf's SAN automatically includes the hostname, `<hostname>.local`, `localhost`, the primary LAN IPv4 address, and the Tailscale MagicDNS name (if Tailscale is connected). Install the **CA** (not the leaf) once on each client; subsequent leaf rotations don't require re-trusting.
|
||||
|
||||
Not part of the `auto` cascade — must be opted into explicitly.
|
||||
|
||||
> **→ See [docs/TRUSTING_THE_LOCAL_CA.md](docs/TRUSTING_THE_LOCAL_CA.md)** for per-platform install instructions (Windows, macOS, Linux, iOS, Android, Firefox).
|
||||
|
||||
---
|
||||
|
||||
## Configuration
|
||||
|
||||
Reference in New Issue
Block a user