Client - SetHostKeyHandler, OnHostKey
[ClientBase] public event HostKeyEventHandler OnHostKey;
[Cpp/Net] Overrides and Events
Handler Return Value
Return false to reject the public-key (host-key) and disconnect. Return true to accept the key.
The host-key handler is invoked while establishing a connection with the SSH server, at progress [ConnectStep]SshKeyExchange. It is mandatory that you register/implement this handler. Otherwise, server (host-key) verification fails and the connection is aborted.
In FlowSshNet, an alternative to implementing this handler is to call Client.AcceptHostKeyXxxx methods, which initializes a built-in host key handler by providing information about trusted host keys.