Skip to content

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
Terminal window
hytte -p 443 -l --le-domains chat.example.com --le-email you@example.com

hytte 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-http and --le-tls.
  • Try --le-staging first 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.

Terminal window
hytte -s

hytte 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.

Terminal window
hytte --cert server.crt --key server.key

For 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.

--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.