Struct hyper_server::tls_openssl::OpenSSLConfig
source · pub struct OpenSSLConfig { /* private fields */ }
Available on crate feature
tls-openssl
only.Expand description
OpenSSL configuration.
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>
This helper will established a TLS server based on strong cipher suites from a PEM formatted certificate and key.
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>
This helper will established a TLS server based on strong cipher suites from a PEM formatted certificate chain and key.
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>
Build the 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 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