getUserMedia (camera/mic), Web Crypto, SameSite=None
cookies, or an OAuth redirect that insists on https://. It’s also what lets the app call a
locally-run API without the browser blocking it as mixed content.
The mechanism is opt-in and zero-config: generate a certificate once and the dev server picks it
up automatically. No certificate — plain HTTP, exactly as before.
One-time: install mkcert
mkcert creates a certificate your machine trusts, so the browser shows no warning.Enable HTTPS for a part
Run this inside whichever part you want served over HTTPS (works the same in every part):localhost.pem + localhost-key.pem into the project root. Then start the dev server as usual —
it detects the pair and serves over HTTPS:
The certificates are gitignored and machine-local — each developer runs
setup-https once. They
never ship: production TLS is terminated by your reverse proxy.
Running the whole stack over HTTPS
npm run setup-httpsin bothshipwide_apiandshipwide_app.- Set the app’s
VITE_BACKEND_URL=https://localhost:3000. - Start both dev servers.
Desktop (Tauri)
Tauri’s dev window loads its owndevUrl, which must match the scheme Vite serves. Use
npm run serve:desktop (instead of tauri dev) and it detects the certificate pair and points
Tauri at the right https:// / http:// URL automatically.
Turn it off
Delete the two.pem files from the project root — the dev server falls back to plain HTTP on
the next start. To also remove the trusted CA, run mkcert -uninstall.