Connections & networking
Saved connection profiles, the transports they ride, the firewall front-doors that open before a connect, and on-device SSH key management.
Connections
Saved profiles with transport selection (SSH, Mosh, Eternal Terminal, VNC, RDP, SPICE, GLKVM, SMB, Email, Cloud Storage, Reticulum, AI endpoints (OpenAI-compatible / Ollama / Anthropic / Gemini), and Bluetooth / BLE / USB serial consoles), pre-authentication KEX host-key TOFU verification and fingerprint change detection, auto-reconnect with backoff, password fallback, local/remote/dynamic port forwarding (-L/-R/-D — the dynamic type runs a built-in SOCKS5 proxy that tunnels traffic through the SSH session), ProxyJump multi-hop tunneling (-J) with tree view, SOCKS5/SOCKS4/HTTP proxy support (Tor .onion compatible), RDP-over-SSH tunnel profiles, DNS resolution with 5s timeout, and connection error safety nets (UI watchdog: 20s for most transports, 5min for storage connects; post-connect shell verification, session manager detection).
Haven also provides a resizable Saved Connections home-screen widget (with optional per-widget connection group filtering and saved-order or recent-first sorting), launcher shortcuts, and intent filters for ssh://, rdp://, vnc://, and haven://connect links (including one-off Connect without saving sessions and the Connections quick-connect bar).
Per-app WireGuard and Tailscale tunnels — each profile can route its connection through its own userspace tunnel, with no system VPN slot taken, so other apps keep using the direct network.
Tunnel underlay reachability — a per-connection tunnel (WireGuard, Tailscale, NetBird, Yggdrasil, OpenVPN, AnyConnect) carries the profile’s connection traffic, while the tunnel’s own underlay sockets dial over the phone’s ordinary network by default. For Yggdrasil tunnels whose tcp:// or tls:// peer is only reachable on a private LAN and Cisco AnyConnect / ocserv gateways on an internal network, Route underlay through in the tunnel editor routes outbound TCP/TLS underlay connections through another saved tunnel’s loopback SOCKS5 listener (auto-starting and reference-counting that one-hop carrier tunnel). When the phone is connected to a LAN Wi-Fi or Ethernet interface that is not the phone’s default route (for example, an isolated router/lab Wi-Fi while mobile data holds internet), Underlay network on WireGuard and Cisco AnyConnect / ocserv tunnels binds underlay sockets and endpoint DNS resolution directly to Wi-Fi, Cellular, or Ethernet via Android’s multinetwork NDK APIs (android_setsocknetwork / android_getaddrinfofornetwork). Non-TCP Yggdrasil peers (quic://) and NetBird management/relay endpoints still dial over the phone’s default network, and NetBird/Yggdrasil dial timeout errors name the underlay reachability limit explicitly.
Port knocking
Optional per-profile knock sequence sent immediately before the real socket open. Format is whitespace- or comma-separated port[/proto] tokens — e.g. 7000 8000 9000 (all TCP) or 7000/tcp 8000/udp 9000/tcp for mixed sequences that match a knockd/fwknop-style configuration. The sequence is fired from the device using ordinary TCP Socket.connect() and DatagramSocket.send() calls (no root, no raw sockets), with a configurable inter-knock delay (default 100 ms) and a fixed 200 ms post-knock settle so the firewall has time to install its rule before SSH/VNC/RDP/SMB connects. Wired into all direct-dial paths; skipped on SSH-tunneled, WireGuard/Tailscale, and SOCKS-routed paths since the knock packet wouldn’t reach the right firewall from the device. Each knock attempt — success or failure — appears in the Connection Log entry’s verbose output as a [knock] ... -> ok in Nms line so post-hoc debugging is possible. The connection-edit dialog includes a Test knock button that runs the sequence once without committing or connecting, returning the result inline.
Single Packet Authorization (fwknop)
The cryptographic alternative to port knocking, interoperable with fwknop/fwknopd. Where a knock sequence is a series of cleartext SYNs that a passive observer can record and replay in order, SPA is a single encrypted, HMAC-authenticated UDP packet — it can’t be read, and the per-packet HMAC plus random/timestamp fields defeat replay. Haven builds the packet itself, natively in Kotlin (no fwknop binary), and sends it on the same pre-connect hook as the knock; if both are configured the SPA goes first.
The implementation follows the fwknop wire format: an SHA-256-digested message encrypted with AES-256-CBC (OpenSSL Salted__ / EVP-BytesToKey-MD5 key derivation) and authenticated with encrypt-then-MAC HMAC-SHA256 — the modern fwknop defaults. The Kotlin builder is verified byte-for-byte against fwknop 2.6.11, and a live fwknopd accepts Haven’s packets and opens the firewall. Per profile you set the Rijndael key and (recommended) HMAC key — each as a passphrase or base64 (--key-base64-rijndael / --key-base64-hmac) — the access spec (tcp/22, or comma-separated for multiple ports), the destination UDP port (default 62201), and the allow-IP mode: Source IP (sends 0.0.0.0, so fwknopd opens for the packet’s own source IP — the right default for a phone behind changing/CGNAT addresses, with no extra round-trip), Resolve public IP (looks up the egress IP first, like fwknop -R), or Explicit IP. Like the knock it runs only on direct-dial paths, logs a [spa] ... -> sent NB in Nms line to the Connection Log, and has a Test SPA button that sends one packet without committing or connecting. Keys are stored encrypted at rest (Android Keystore-backed AEAD), and the set_spa/test_spa MCP tools never echo key material back. v1 is AES-CBC + HMAC-SHA256 over UDP only — no GPG mode, alternate cipher/digest modes, or NAT-access.
SSH Keys
Generate Ed25519, RSA, and ECDSA keys on-device. Import keys from file (PEM/OpenSSH/Dropbear format, including hybrid post-quantum ssh-mldsa44-ed25519 keys on the sshlib engine) or paste from clipboard. FIDO2/SK hardware key support (ed25519-sk, ecdsa-sk) via NFC or USB security keys — and a phone-hosted security key can be forwarded to a remote host (see USB device forwarding). One-tap public key copy and deploy key dialog for authorized_keys setup. Assign specific keys to individual connections.
Security-chip keys
Keys → Generate can also mint the keypair inside the phone’s secure chip — the StrongBox security element when the device has one, otherwise the TEE. These are always ECDSA P-256, and the private half never leaves the chip: Haven itself only ever holds the public line.
What that buys, and costs:
- Every sign-in asks for you. Each SSH authentication with a security-chip key requires a fresh biometric confirmation (fingerprint or Class 3 face) on the phone — and only when the server actually accepts that key, so servers that don’t know the key never trigger a prompt. Declining aborts that connection; Haven doesn’t quietly slide on to the next credential.
- Nothing to steal. The private key can’t be exported, copied, or backed up — there is no path off the chip, not even for Haven.
- No survivors. A factory reset destroys the key, and re-enrolling any biometric invalidates it (the key then needs to be deleted and re-created). Encrypted backups note how many hardware-backed keys were left out, since they cannot travel.
Worth knowing: they work with OpenSSH CA certificates like any other key, but headless paths that can’t raise a biometric prompt (the MCP tunnel, agent-driven connects) don’t use them, and a profile switched to the experimental sshlib engine refuses to connect with one until it’s switched back to the default engine.