pub enum ConnectionAddr {
Tcp(String, u16),
TcpTls {
host: String,
port: u16,
insecure: bool,
tls_params: Option<TlsConnParams>,
},
Unix(PathBuf),
}
Expand description
Defines the connection address.
Not all connection addresses are supported on all platforms. For instance to connect to a unix socket you need to run this on an operating system that supports them.
Variants§
Tcp(String, u16)
Format for this is (host, port)
.
TcpTls
Format for this is (host, port)
.
Fields
insecure: bool
Disable hostname verification when connecting.
§Warning
You should think very carefully before you use this method. If hostname verification is not used, any valid certificate for any site will be trusted for use from any other. This introduces a significant vulnerability to man-in-the-middle attacks.
Unix(PathBuf)
Format for this is the path to the unix socket.
Implementations§
Source§impl ConnectionAddr
impl ConnectionAddr
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Checks if this address is supported.
Because not all platforms support all connection addresses this is a quick way to figure out if a connection method is supported. Currently this affects:
-
Unix socket addresses, which are supported only on Unix
-
TLS addresses, which are supported only if a TLS feature is enabled (either
tls-native-tls
ortls-rustls
).
Sourcepub fn set_danger_accept_invalid_hostnames(&mut self, insecure: bool)
pub fn set_danger_accept_invalid_hostnames(&mut self, insecure: bool)
Configure this address to connect without checking certificate hostnames.
§Warning
You should think very carefully before you use this method. If hostname verification is not used, any valid certificate for any site will be trusted for use from any other. This introduces a significant vulnerability to man-in-the-middle attacks.
Trait Implementations§
Source§impl Clone for ConnectionAddr
impl Clone for ConnectionAddr
Source§fn clone(&self) -> ConnectionAddr
fn clone(&self) -> ConnectionAddr
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ConnectionAddr
impl Debug for ConnectionAddr
Source§impl Display for ConnectionAddr
impl Display for ConnectionAddr
Source§impl PartialEq for ConnectionAddr
impl PartialEq for ConnectionAddr
impl Eq for ConnectionAddr
Auto Trait Implementations§
impl Freeze for ConnectionAddr
impl RefUnwindSafe for ConnectionAddr
impl Send for ConnectionAddr
impl Sync for ConnectionAddr
impl Unpin for ConnectionAddr
impl UnwindSafe for ConnectionAddr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.