Struct TlsAcceptorService
pub struct TlsAcceptorService<S> { /* private fields */ }rustls only.Expand description
A Service which accepts TLS connections and delegates the underlying transport
stream to the given service.
Connections that do not override the TLS configuration share one native configuration, built on first use; clones of this service share it.
Implementations§
§impl<S> TlsAcceptorService<S>
impl<S> TlsAcceptorService<S>
pub fn new(
config: TlsServerConfig,
inner: S,
store_client_hello: bool,
) -> TlsAcceptorService<S>
pub fn new( config: TlsServerConfig, inner: S, store_client_hello: bool, ) -> TlsAcceptorService<S>
Creates a new TlsAcceptorService from a copy of config; later changes to it do not apply.
pub fn with_session_resumption(self, enabled: bool) -> TlsAcceptorService<S>
pub fn with_session_resumption(self, enabled: bool) -> TlsAcceptorService<S>
Let clients resume sessions of earlier connections to this acceptor. Off by default, and then the shared configuration issues no session tickets.
Tickets are encrypted under a key of this acceptor’s shared configuration, so no
other acceptor can resume them; clones of this service share it. Without the
aws-lc or ring feature, sessions are kept in a bounded in-memory cache instead.
Connections that override the TLS configuration are built per connection.
Configurations with a modify hook or dynamic provider cannot resume sessions:
their selected client verifier is unavailable for rechecking restored chains.
Static configurations recheck the entire restored client path before serving.
pub fn set_session_resumption(
&mut self,
enabled: bool,
) -> &mut TlsAcceptorService<S>
pub fn set_session_resumption( &mut self, enabled: bool, ) -> &mut TlsAcceptorService<S>
Let clients resume sessions of earlier connections to this acceptor. Off by default, and then the shared configuration issues no session tickets.
Tickets are encrypted under a key of this acceptor’s shared configuration, so no
other acceptor can resume them; clones of this service share it. Without the
aws-lc or ring feature, sessions are kept in a bounded in-memory cache instead.
Connections that override the TLS configuration are built per connection.
Configurations with a modify hook or dynamic provider cannot resume sessions:
their selected client verifier is unavailable for rechecking restored chains.
Static configurations recheck the entire restored client path before serving.
pub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes self, returning the underlying service.
Trait Implementations§
§impl<S> Clone for TlsAcceptorService<S>where
S: Clone,
impl<S> Clone for TlsAcceptorService<S>where
S: Clone,
§fn clone(&self) -> TlsAcceptorService<S>
fn clone(&self) -> TlsAcceptorService<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<S> Debug for TlsAcceptorService<S>where
S: Debug,
impl<S> Debug for TlsAcceptorService<S>where
S: Debug,
§impl<S> ExtensionsRef for TlsAcceptorService<S>where
S: ExtensionsRef,
impl<S> ExtensionsRef for TlsAcceptorService<S>where
S: ExtensionsRef,
§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
Extensions store§impl<S, IO> Service<IO> for TlsAcceptorService<S>
impl<S, IO> Service<IO> for TlsAcceptorService<S>
§async fn serve(
&self,
stream: IO,
) -> Result<<TlsAcceptorService<S> as Service<IO>>::Output, <TlsAcceptorService<S> as Service<IO>>::Error>
async fn serve( &self, stream: IO, ) -> Result<<TlsAcceptorService<S> as Service<IO>>::Output, <TlsAcceptorService<S> as Service<IO>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for TlsAcceptorService<S>
impl<S> !UnwindSafe for TlsAcceptorService<S>
impl<S> Forget for TlsAcceptorService<S>
impl<S> Freeze for TlsAcceptorService<S>where
*const ArcInner<Node> is !null: Freeze,
PhantomData<ArcInner<Node>>: Freeze,
*const ArcInner<SharedConfig> is !null: Freeze,
PhantomData<ArcInner<SharedConfig>>: Freeze,
S: Freeze,
impl<S> Move for TlsAcceptorService<S>
impl<S> Send for TlsAcceptorService<S>
impl<S> Sync for TlsAcceptorService<S>
impl<S> Unpin for TlsAcceptorService<S>
impl<S> UnsafeUnpin for TlsAcceptorService<S>where
*const ArcInner<Node> is !null: UnsafeUnpin,
PhantomData<ArcInner<Node>>: UnsafeUnpin,
*const ArcInner<SharedConfig> is !null: UnsafeUnpin,
PhantomData<ArcInner<SharedConfig>>: UnsafeUnpin,
S: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<S, Input, Connection> ConnectorService<Input> for Swhere
S: Service<Input, Output = EstablishedClientConnection<Connection, Input>>,
<S as Service<Input>>::Error: Into<ConnectionError>,
Connection: Send + ExtensionsRef,
impl<S, Input, Connection> ConnectorService<Input> for Swhere
S: Service<Input, Output = EstablishedClientConnection<Connection, Input>>,
<S as Service<Input>>::Error: Into<ConnectionError>,
Connection: Send + ExtensionsRef,
§type Connection = Connection
type Connection = Connection
ConnectorService§fn connect(
&self,
input: Input,
) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, ConnectionError>> + Send
fn connect( &self, input: Input, ) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, ConnectionError>> + Send
§impl<T> ForwardedClientExt for Twhere
T: ExtensionsRef + ?Sized,
impl<T> ForwardedClientExt for Twhere
T: ExtensionsRef + ?Sized,
§fn trusted_forwarded(&self) -> Option<&Forwarded>
fn trusted_forwarded(&self) -> Option<&Forwarded>
§fn forwarded_client(&self) -> Option<&ForwardedElement>
fn forwarded_client(&self) -> Option<&ForwardedElement>
§fn forwarded_client_ip(&self) -> Option<IpAddr>
fn forwarded_client_ip(&self) -> Option<IpAddr>
for node.§fn forwarded_client_socket_addr(&self) -> Option<SocketAddress>
fn forwarded_client_socket_addr(&self) -> Option<SocketAddress>
for node.§fn forwarded_client_host(&self) -> Option<&ForwardedAuthority>
fn forwarded_client_host(&self) -> Option<&ForwardedAuthority>
§fn forwarded_client_proto(&self) -> Option<ForwardedProtocol>
fn forwarded_client_proto(&self) -> Option<ForwardedProtocol>
§fn forwarded_client_version(&self) -> Option<ForwardedVersion>
fn forwarded_client_version(&self) -> Option<ForwardedVersion>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<Io, S> MakeMockServer<Io, ServerClone> for S
impl<Io, S> MakeMockServer<Io, ServerClone> for S
type Server = S
fn make_server(&self, _: &ConnectRequest) -> S
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more