pub struct RustlsConfig { /* private fields */ }
Expand description
Rustls configuration.
Implementations§
Source§impl RustlsConfig
impl RustlsConfig
Sourcepub fn from_config(config: Arc<ServerConfig>) -> Self
pub fn from_config(config: Arc<ServerConfig>) -> Self
Create config from Arc<
ServerConfig
>
.
NOTE: You need to set ALPN protocols (like http/1.1
or h2
) manually.
Sourcepub async fn from_der(cert: Vec<Vec<u8>>, key: Vec<u8>) -> Result<Self>
pub async fn from_der(cert: Vec<Vec<u8>>, key: Vec<u8>) -> Result<Self>
Create config from DER-encoded data.
The certificate must be DER-encoded X.509.
The private key must be DER-encoded ASN.1 in either PKCS#8 or PKCS#1 format.
Sourcepub async fn from_pem(cert: Vec<u8>, key: Vec<u8>) -> Result<Self>
pub async fn from_pem(cert: Vec<u8>, key: Vec<u8>) -> Result<Self>
Create config from PEM formatted data.
Certificate and private key must be in PEM format.
Sourcepub async fn from_pem_file(
cert: impl AsRef<Path>,
key: impl AsRef<Path>,
) -> Result<Self>
pub async fn from_pem_file( cert: impl AsRef<Path>, key: impl AsRef<Path>, ) -> Result<Self>
Create config from PEM formatted files.
Contents of certificate file and private key file must be in PEM format.
Sourcepub fn get_inner(&self) -> Arc<ServerConfig>
pub fn get_inner(&self) -> Arc<ServerConfig>
Get inner Arc<
ServerConfig
>
.
Sourcepub fn reload_from_config(&self, config: Arc<ServerConfig>)
pub fn reload_from_config(&self, config: Arc<ServerConfig>)
Reload config from Arc<
ServerConfig
>
.
Sourcepub async fn reload_from_der(
&self,
cert: Vec<Vec<u8>>,
key: Vec<u8>,
) -> Result<()>
pub async fn reload_from_der( &self, cert: Vec<Vec<u8>>, key: Vec<u8>, ) -> Result<()>
Reload config from DER-encoded data.
The certificate must be DER-encoded X.509.
The private key must be DER-encoded ASN.1 in either PKCS#8 or PKCS#1 format.
Sourcepub async fn from_pem_chain_file(
chain: impl AsRef<Path>,
key: impl AsRef<Path>,
) -> Result<Self>
pub async fn from_pem_chain_file( chain: impl AsRef<Path>, key: impl AsRef<Path>, ) -> Result<Self>
This helper will establish a TLS server based on strong cipher suites from a PEM-formatted certificate chain and key.
Trait Implementations§
Source§impl Clone for RustlsConfig
impl Clone for RustlsConfig
Source§fn clone(&self) -> RustlsConfig
fn clone(&self) -> RustlsConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more