pub enum TlsConfiguration {
Simple {
ca: Vec<u8>,
alpn: Option<Vec<Vec<u8>>>,
client_auth: Option<(Vec<u8>, Vec<u8>)>,
},
SimpleNative {
ca: Vec<u8>,
client_auth: Option<(Vec<u8>, String)>,
},
Rustls(Arc<ClientConfig>),
Native,
NativeConnector(TlsConnector),
}Available on crate features
use-rustls-no-provider or use-native-tls only.Expand description
TLS configuration method
Variants§
Simple
Available on crate feature
use-rustls-no-provider only.Fields
SimpleNative
Available on crate feature
use-native-tls only.Fields
Rustls(Arc<ClientConfig>)
Available on crate feature
use-rustls-no-provider only.Injected rustls ClientConfig for TLS, to allow more customisation.
Native
Available on crate feature
use-native-tls only.Use default native-tls configuration
NativeConnector(TlsConnector)
Available on crate feature
use-native-tls only.Injected native-tls TlsConnector for TLS, to allow more customisation.
Implementations§
Source§impl TlsConfiguration
impl TlsConfiguration
Sourcepub fn default_rustls() -> TlsConfiguration
Available on crate feature use-rustls-no-provider only.
pub fn default_rustls() -> TlsConfiguration
use-rustls-no-provider only.Builds a rustls client configuration backed by the platform root store.
§Panics
Panics if loading native certificates fails or a certificate cannot be inserted into the root store.
Sourcepub fn simple_native(
ca: Vec<u8>,
client_auth: Option<(Vec<u8>, String)>,
) -> TlsConfiguration
Available on crate feature use-native-tls only.
pub fn simple_native( ca: Vec<u8>, client_auth: Option<(Vec<u8>, String)>, ) -> TlsConfiguration
use-native-tls only.Builds a native-tls configuration from PEM CA bytes and optional PKCS#12 client identity data.
pub fn default_native() -> TlsConfiguration
Available on crate feature
use-native-tls only.Trait Implementations§
Source§impl Clone for TlsConfiguration
impl Clone for TlsConfiguration
Source§fn clone(&self) -> TlsConfiguration
fn clone(&self) -> TlsConfiguration
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 TlsConfiguration
impl Debug for TlsConfiguration
Source§impl From<ClientConfig> for TlsConfiguration
Available on crate feature use-rustls-no-provider only.
impl From<ClientConfig> for TlsConfiguration
Available on crate feature
use-rustls-no-provider only.Source§fn from(config: ClientConfig) -> TlsConfiguration
fn from(config: ClientConfig) -> TlsConfiguration
Converts to this type from the input type.
Source§impl From<TlsConnector> for TlsConfiguration
Available on crate feature use-native-tls only.
impl From<TlsConnector> for TlsConfiguration
Available on crate feature
use-native-tls only.Source§fn from(connector: TlsConnector) -> TlsConfiguration
fn from(connector: TlsConnector) -> TlsConfiguration
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TlsConfiguration
impl !RefUnwindSafe for TlsConfiguration
impl Send for TlsConfiguration
impl Sync for TlsConfiguration
impl Unpin for TlsConfiguration
impl UnsafeUnpin for TlsConfiguration
impl !UnwindSafe for TlsConfiguration
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