pub struct UpstreamTls {
client: Option<(Vec<CertificateDer<'static>>, PrivateKeyDer<'static>)>,
ca: Option<Vec<CertificateDer<'static>>>,
pub verify: bool,
key: u64,
}Fields§
§client: Option<(Vec<CertificateDer<'static>>, PrivateKeyDer<'static>)>§ca: Option<Vec<CertificateDer<'static>>>§verify: boolVerify the upstream’s certificate. false still presents the client
cert — the handshake is mutual, verification of the peer is skipped.
key: u64Implementations§
Source§impl UpstreamTls
impl UpstreamTls
Sourcepub fn load(
client_paths: Option<(&str, &str)>,
ca_path: Option<&str>,
verify: bool,
) -> Result<Arc<Self>, String>
pub fn load( client_paths: Option<(&str, &str)>, ca_path: Option<&str>, verify: bool, ) -> Result<Arc<Self>, String>
Loads and validates an identity. client_paths is (cert, key) —
pairing of the two YAML keys is enforced by the caller’s config parse.
Reads + PEM-parses every file and dry-builds the rustls config so
unreadable files, empty bundles, and cert/key mismatches all fail here,
at policy-compile time.
Sourcepub fn cache_key(&self) -> u64
pub fn cache_key(&self) -> u64
Content-hash key (PEM bytes + verify flag). Stable within a process — exactly the lifetime of the caches it keys.
Sourcepub fn client_config(&self) -> Result<ClientConfig, String>
pub fn client_config(&self) -> Result<ClientConfig, String>
Builds a rustls client config from the loaded materials. ALPN is left unset — the HTTP client and the wss connector want different values.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UpstreamTls
impl RefUnwindSafe for UpstreamTls
impl Send for UpstreamTls
impl Sync for UpstreamTls
impl Unpin for UpstreamTls
impl UnsafeUnpin for UpstreamTls
impl UnwindSafe for UpstreamTls
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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