pub struct OpenSSLConfig { /* private fields */ }
Available on crate feature
tls-openssl
only.Expand description
Represents configuration options for an OpenSSL-based server.
This configuration is used when constructing a new OpenSSLAcceptor
.
Implementations§
Source§impl OpenSSLConfig
impl OpenSSLConfig
Sourcepub fn from_pem_file<A: AsRef<Path>, B: AsRef<Path>>(
cert: A,
key: B,
) -> Result<Self, OpenSSLError>
pub fn from_pem_file<A: AsRef<Path>, B: AsRef<Path>>( cert: A, key: B, ) -> Result<Self, OpenSSLError>
Sourcepub fn from_pem_chain_file<A: AsRef<Path>, B: AsRef<Path>>(
chain: A,
key: B,
) -> Result<Self, OpenSSLError>
pub fn from_pem_chain_file<A: AsRef<Path>, B: AsRef<Path>>( chain: A, key: B, ) -> Result<Self, OpenSSLError>
Trait Implementations§
Source§impl Clone for OpenSSLConfig
impl Clone for OpenSSLConfig
Source§fn clone(&self) -> OpenSSLConfig
fn clone(&self) -> OpenSSLConfig
Returns a copy 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 OpenSSLConfig
impl Debug for OpenSSLConfig
Source§impl TryFrom<SslAcceptorBuilder> for OpenSSLConfig
impl TryFrom<SslAcceptorBuilder> for OpenSSLConfig
Source§fn try_from(tls_builder: SslAcceptorBuilder) -> Result<Self, Self::Error>
fn try_from(tls_builder: SslAcceptorBuilder) -> Result<Self, Self::Error>
Constructs OpenSSLConfig
from an SslAcceptorBuilder
. This allows precise
control over the settings that will be used by OpenSSL in this server.
§Example
use hyper_server::tls_openssl::OpenSSLConfig;
use openssl::ssl::{SslAcceptor, SslMethod};
use std::convert::TryFrom;
#[tokio::main]
async fn main() {
let mut tls_builder = SslAcceptor::mozilla_modern_v5(SslMethod::tls())
.unwrap();
// Set configurations like set_certificate_chain_file or
// set_private_key_file.
// let tls_builder.set_ ... ;
let _config = OpenSSLConfig::try_from(tls_builder);
}
Auto Trait Implementations§
impl Freeze for OpenSSLConfig
impl RefUnwindSafe for OpenSSLConfig
impl Send for OpenSSLConfig
impl Sync for OpenSSLConfig
impl Unpin for OpenSSLConfig
impl UnwindSafe for OpenSSLConfig
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