mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-24 16:41:30 +02:00
Regular (non-NetBird) servers used InsecureIgnoreHostKey while also offering the user's password, so an impersonating endpoint could collect it. Replace that with a per-profile known-hosts store: an unknown host returns a marker carrying the fingerprint so the client can show it and, once confirmed, retry with the key trusted and persisted; a changed key is rejected outright, as OpenSSH does. The confirmation is single-use and cleared once the key is stored. The server-type switch now handles the regular case explicitly and rejects unknown types instead of routing them through the unverified path. Java sets the store path (per profile, since an overlay IP is a different host under a different profile) and can drop a host's key once no session targets it.