pub struct CertInjectorAcceptor { /* private fields */ }Expand description
An acceptor that wraps RustlsAcceptor to inject the verified client
certificate into request extensions.
After the TLS handshake completes, this acceptor extracts the end-entity
peer certificate from the TlsStream and wraps the service with an
AddExtension layer containing VerifiedTlsClientCert.
§Example
ⓘ
use axum_server::tls_rustls::{RustlsAcceptor, RustlsConfig};
use lexe_api::tls_acceptor::CertInjectorAcceptor;
let rustls_config = RustlsConfig::from_config(tls_config);
let rustls_acceptor = RustlsAcceptor::new(rustls_config);
let acceptor = CertInjectorAcceptor::new(rustls_acceptor);
axum_server::from_tcp(listener)
.acceptor(acceptor)
.serve(make_service)
.awaitImplementations§
Source§impl CertInjectorAcceptor
impl CertInjectorAcceptor
Sourcepub fn new(inner: RustlsAcceptor) -> Self
pub fn new(inner: RustlsAcceptor) -> Self
Create a new CertInjectorAcceptor wrapping the given
RustlsAcceptor.
Trait Implementations§
Source§impl<I, S> Accept<I, S> for CertInjectorAcceptor
impl<I, S> Accept<I, S> for CertInjectorAcceptor
Source§type Service = AddExtension<S, VerifiedTlsClientCert>
type Service = AddExtension<S, VerifiedTlsClientCert>
Service produced by accept.
Source§impl Clone for CertInjectorAcceptor
impl Clone for CertInjectorAcceptor
Source§fn clone(&self) -> CertInjectorAcceptor
fn clone(&self) -> CertInjectorAcceptor
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for CertInjectorAcceptor
impl !UnwindSafe for CertInjectorAcceptor
impl Freeze for CertInjectorAcceptor
impl Send for CertInjectorAcceptor
impl Sync for CertInjectorAcceptor
impl Unpin for CertInjectorAcceptor
impl UnsafeUnpin for CertInjectorAcceptor
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