Skip to main content

TlsConfig

Struct TlsConfig 

Source
pub struct TlsConfig {
    pub enabled: bool,
    pub cert_file: String,
    pub key_file: String,
    pub client_auth: ClientAuthMode,
    pub ca_file: String,
    pub min_protocol: String,
    pub max_protocol: String,
    pub ciphersuites: Vec<String>,
    pub ocsp_stapling: OcspStaplingConfig,
}
Expand description

[tls] section — TLS configuration for the EST listener.

§NIAP CA PP FTP_TRP.1 compliance

  • TLS 1.2 is the minimum supported version; TLS 1.0 and 1.1 are rejected.
  • Only AEAD cipher suites with forward secrecy (ECDHE/DHE key exchange) are permitted.
  • The default cipher suite list excludes CBC-mode suites and static RSA key exchange.

Fields§

§enabled: bool

Enable TLS on the EST listener. Default: false.

When false, the server listens in plain HTTP mode (intended only for development behind a TLS-terminating reverse proxy).

§cert_file: String

Path to the server certificate chain in PEM format.

The file MUST contain the server’s end-entity certificate first, followed by any intermediate CA certificates.

§key_file: String

Path to the server private key in PEM format.

§client_auth: ClientAuthMode

Client certificate authentication mode.

  • required — mTLS is mandatory; unauthenticated clients are rejected at the TLS layer.
  • optional (default) — the server requests a client certificate but accepts connections without one. EST enrollment can fall back to HTTP-layer authentication (OTP, HTTP Basic, etc.).
  • none — no client certificate is requested.
§ca_file: String

Path to the CA certificate bundle (PEM) for validating EST client certificates.

RHELBU-3536 R18: this truststore is dedicated to the EST listener. Admin operator mTLS uses a separate truststore configured in [admin].

§min_protocol: String

Minimum TLS protocol version.

NIAP CA PP FTP_TRP.1: must be "1.2" or "1.3". Default: "1.2".

§max_protocol: String

Maximum TLS protocol version.

Default: "1.3".

§ciphersuites: Vec<String>

Allowed cipher suites (IANA names).

When empty, the server uses the rustls default selection which already satisfies FTP_TRP.1 (AEAD + forward secrecy only).

Example:

ciphersuites = [
    "TLS_AES_256_GCM_SHA384",
    "TLS_AES_128_GCM_SHA256",
    "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
    "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
]
§ocsp_stapling: OcspStaplingConfig

OCSP stapling configuration (RFC 7633 / RFC 6066 Section 8).

When the server’s TLS certificate contains the TLS Feature Extension (must-staple, OID 1.3.6.1.5.5.7.1.24), OCSP stapling MUST be enabled to satisfy RFC 7633 Section 4 requirements. Clients that understand must-staple will abort the handshake if no stapled OCSP response is provided.

Even without must-staple, enabling OCSP stapling improves TLS handshake performance by eliminating the client-side OCSP lookup.

Implementations§

Source§

impl TlsConfig

Source

pub fn validate(&self) -> Result<(), String>

Validate TLS configuration constraints.

Trait Implementations§

Source§

impl Clone for TlsConfig

Source§

fn clone(&self) -> TlsConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TlsConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TlsConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TlsConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,