HTTPS and certificates
hytte encrypts everything in the browser with WebCrypto, which browsers only allow on a secure origin: https://, or http://localhost on the same machine. So anything beyond trying it locally needs HTTPS. There are five ways, and you only need one:
| Way | Good for |
|---|---|
--tunnel |
Trying it out, a quick session, no domain or open ports |
| Named Cloudflare tunnel | Your own domain, no open ports, passkeys work |
| Reverse proxy | You already run Caddy, nginx or Traefik |
| Let’s Encrypt built in | A server with a domain and ports 80/443 |
| Self-signed / your own certificate | A LAN or a lab |
Let’s Encrypt
Section titled “Let’s Encrypt”hytte -p 443 -l --le-domains chat.example.com --le-email you@example.comhytte gets a trusted certificate and renews it in the background. The certificates are cached in the data directory. Requirements:
- DNS for each domain in
--le-domains(comma-separated) points to this server. - Ports 80 and 443 reach hytte from the internet, for the HTTP-01 and TLS-ALPN-01 challenges. If you forward them to other local ports, set
--le-httpand--le-tls. - Try
--le-stagingfirst if you’re experimenting: the staging CA has much higher rate limits. Its certificates aren’t trusted by browsers.
--le-domains also sets --domain to the first domain, which enables passkeys.
Self-signed
Section titled “Self-signed”hytte -shytte creates a certificate once and keeps it in <data-dir>/tls, so people only have to accept it once. At startup it logs the certificate’s SHA-256 fingerprint. Compare it with the one your browser shows before you accept the warning.
Your own certificate
Section titled “Your own certificate”hytte --cert server.crt --key server.keyFor example, a certificate from your company CA or a wildcard you already have. hytte reads the files at startup, so restart it after renewing them.
Tunnels with HTTPS
Section titled “Tunnels with HTTPS”--tunnel works with all of the above (hytte -s -t). It connects to hytte on the local machine over HTTPS and skips certificate checks there. That’s safe because the connection never leaves the machine.