pub struct OpenSslAcceptor(/* private fields */);Expand description
trillium Acceptor for openssl
Implementations§
Source§impl OpenSslAcceptor
impl OpenSslAcceptor
Sourcepub fn new(acceptor: SslAcceptor) -> Self
pub fn new(acceptor: SslAcceptor) -> Self
build a new OpenSslAcceptor from a SslAcceptor
Sourcepub fn from_single_cert(cert: &[u8], key: &[u8]) -> Self
pub fn from_single_cert(cert: &[u8], key: &[u8]) -> Self
build a new OpenSslAcceptor from a PEM-encoded cert chain and PEM-encoded private key.
Defaults to advertising [h2, http/1.1] via ALPN. Use Self::without_http2 to
drop HTTP/2.
§Example
use trillium_openssl::OpenSslAcceptor;
const KEY: &[u8] = include_bytes!("../examples/key.pem");
const CERT: &[u8] = include_bytes!("../examples/cert.pem");
let acceptor = OpenSslAcceptor::from_single_cert(CERT, KEY);Sourcepub fn from_pkcs12(der: &[u8], password: &str) -> Self
pub fn from_pkcs12(der: &[u8], password: &str) -> Self
build a new OpenSslAcceptor from a pkcs12 archive and password.
Sourcepub fn without_http2(self) -> Self
pub fn without_http2(self) -> Self
Drop h2 from the ALPN protocol list, forcing HTTP/1.1 over TLS.
Has no effect on acceptors constructed from a pre-built SslAcceptor via
Self::new — those manage their own ALPN configuration.
Trait Implementations§
Source§impl<Input> Acceptor<Input> for OpenSslAcceptorwhere
Input: Transport,
impl<Input> Acceptor<Input> for OpenSslAcceptorwhere
Input: Transport,
Source§type Error = Error
type Error = Error
An error type that
Acceptor::accept may returnSource§type Output = OpenSslServerTransport<Input>
type Output = OpenSslServerTransport<Input>
The stream type. For example,
TlsStream<Input>Source§impl Clone for OpenSslAcceptor
impl Clone for OpenSslAcceptor
Source§fn clone(&self) -> OpenSslAcceptor
fn clone(&self) -> OpenSslAcceptor
Returns a duplicate of the value. Read more
1.0.0 · 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 OpenSslAcceptor
impl Debug for OpenSslAcceptor
Source§impl From<SslAcceptor> for OpenSslAcceptor
impl From<SslAcceptor> for OpenSslAcceptor
Source§fn from(acceptor: SslAcceptor) -> Self
fn from(acceptor: SslAcceptor) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OpenSslAcceptor
impl RefUnwindSafe for OpenSslAcceptor
impl Send for OpenSslAcceptor
impl Sync for OpenSslAcceptor
impl Unpin for OpenSslAcceptor
impl UnsafeUnpin for OpenSslAcceptor
impl UnwindSafe for OpenSslAcceptor
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