pub struct RustlsConfig { /* private fields */ }
Available on crate features server and rustls only.
Expand description

Rustls Config.

Implementations

Create a new tls config object.

👎Deprecated: replaced by RustlsConfig::fallback

Sets the certificates.

👎Deprecated: replaced by RustlsConfig::fallback

Sets the private key.

👎Deprecated: replaced by RustlsConfig::fallback

Sets the DER-encoded OCSP response.

If the certificate corresponding to the SNI name is not found, it will fall back to this certificate.

Examples
use poem::listener::{Listener, RustlsCertificate, RustlsConfig, TcpListener};


let config =
    RustlsConfig::new().fallback(RustlsCertificate::new().cert(cert_bytes).key(key_bytes));
let listener = TcpListener::bind("127.0.0.1:3000").rustls(config);

Add a new certificate to be used for the given SNI name.

Sets the trust anchor for optional client authentication.

Sets the trust anchor for required client authentication.

Trait Implementations

Returns the “default value” for a type. Read more
Represents a tls config stream.
Consume itself and return tls config stream.
Represents a tls config stream.
Consume itself and return tls config stream.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Attaches the current Context to this type, returning a WithContext wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more