pub enum HostKeyPolicy {
Strict {
known_hosts_path: Option<String>,
},
AcceptNew,
Insecure,
}Expand description
How the server’s host key is verified during the SSH handshake.
Defaults to AcceptNew. The insecure, verification-off
mode is a distinct explicit variant so it can never be selected by
accident.
Variants§
Strict
Reject any host key that is not already recorded in known_hosts.
The most secure policy; requires the key to be pre-provisioned.
Fields
AcceptNew
Trust-on-first-use: accept and record a host key the first time it is
seen (in ~/.ssh/known_hosts), but reject a key that has changed
from a previously recorded one. This is the default.
Insecure
Disable host-key verification entirely. Insecure — vulnerable to man-in-the-middle attacks. Use only against trusted networks / test servers.
Trait Implementations§
Source§impl Clone for HostKeyPolicy
impl Clone for HostKeyPolicy
Source§fn clone(&self) -> HostKeyPolicy
fn clone(&self) -> HostKeyPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HostKeyPolicy
impl Debug for HostKeyPolicy
Source§impl Default for HostKeyPolicy
impl Default for HostKeyPolicy
Source§fn default() -> HostKeyPolicy
fn default() -> HostKeyPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for HostKeyPolicy
impl<'de> Deserialize<'de> for HostKeyPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for HostKeyPolicy
impl JsonSchema for HostKeyPolicy
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for HostKeyPolicy
impl RefUnwindSafe for HostKeyPolicy
impl Send for HostKeyPolicy
impl Sync for HostKeyPolicy
impl Unpin for HostKeyPolicy
impl UnsafeUnpin for HostKeyPolicy
impl UnwindSafe for HostKeyPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more