pub struct RustlsConnector(/* private fields */);Expand description
A rustls TLS connector ready to perform TLS handshakes.
Wraps an Arc<ClientConfig> and can be built from a RustlsConnectorConfig via
connector_with_no_client_auth or
connector_with_single_cert, or
directly from a ClientConfig via the From impl.
Implementations§
Source§impl RustlsConnector
impl RustlsConnector
Sourcepub fn new_with_webpki_root_certs() -> Result<RustlsConnector, Error>
pub fn new_with_webpki_root_certs() -> Result<RustlsConnector, Error>
Create a new RustlsConnector using the webpki-root certs (requires webpki-root-certs feature enabled)
§Errors
Returns an error if we fail to init our verifier
Sourcepub fn new_with_platform_verifier() -> Result<RustlsConnector, Error>
pub fn new_with_platform_verifier() -> Result<RustlsConnector, Error>
Create a new RustlsConnector using the rustls-platform-verifier mechanism (requires platform-verifier feature enabled)
§Errors
Returns an error if we fail to init our verifier
Sourcepub fn new_with_native_certs() -> Result<RustlsConnector, Error>
pub fn new_with_native_certs() -> Result<RustlsConnector, Error>
Create a new RustlsConnector using the system certs (requires native-certs feature enabled)
§Errors
Returns an error if we fail to load the native certs.
Sourcepub fn connect<S>(
&self,
domain: &str,
stream: S,
) -> Result<StreamOwned<ClientConnection, S>, HandshakeError<S>>
pub fn connect<S>( &self, domain: &str, stream: S, ) -> Result<StreamOwned<ClientConnection, S>, HandshakeError<S>>
Connect to the given host
§Errors
Returns a HandshakeError containing either the current state of the handshake or the
failure when we couldn’t complete the handshake
Trait Implementations§
Source§impl Clone for RustlsConnector
impl Clone for RustlsConnector
Source§fn clone(&self) -> RustlsConnector
fn clone(&self) -> RustlsConnector
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RustlsConnector
impl Debug for RustlsConnector
Source§impl From<Arc<ClientConfig>> for RustlsConnector
impl From<Arc<ClientConfig>> for RustlsConnector
Source§fn from(config: Arc<ClientConfig>) -> RustlsConnector
fn from(config: Arc<ClientConfig>) -> RustlsConnector
Source§impl From<ClientConfig> for RustlsConnector
impl From<ClientConfig> for RustlsConnector
Source§fn from(config: ClientConfig) -> RustlsConnector
fn from(config: ClientConfig) -> RustlsConnector
Auto Trait Implementations§
impl Freeze for RustlsConnector
impl !RefUnwindSafe for RustlsConnector
impl Send for RustlsConnector
impl Sync for RustlsConnector
impl Unpin for RustlsConnector
impl UnsafeUnpin for RustlsConnector
impl !UnwindSafe for RustlsConnector
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more