pub struct ServerConfigs { /* private fields */ }Expand description
The server configurations of one listener whose connections reach rustls without this crate’s accept helpers, such as quinn, which runs the verifier on threads of its own and takes a configuration per incoming connection.
Built once, by ServerBuilder::configs, from the identity, ALPN list and Policy
(checked then), it gives a
configuration for each connection’s addresses with for_connection.
Those configurations share one session cache and ticketer, so with
Policy::allow_resumption a client resumes across connections; waiting entries are
recorded under the connection’s source, and a policy’s access control list is decided from
its addresses. Cloning is cheap and shares the session state.
Implementations§
Source§impl ServerConfigs
impl ServerConfigs
Sourcepub fn non_defaults(&self) -> &[NonDefault]
pub fn non_defaults(&self) -> &[NonDefault]
Every setting of the policy that differs from the default, as the configuration builders report it.
Sourcepub fn for_connection(
&self,
source: SocketAddr,
local: SocketAddr,
) -> Result<ConnectionConfig, PeerError>
pub fn for_connection( &self, source: SocketAddr, local: SocketAddr, ) -> Result<ConnectionConfig, PeerError>
The configuration of one connection from source to local.
Waiting entries are recorded under source; a policy’s access control list is decided
from these addresses, by address when the ClientHello arrives and by the client
certificate’s fingerprint before the trust store is consulted. The first refusal of
the handshake is kept in the returned ConnectionConfig, since a host such as quinn
reports a failed server handshake only by its alert.
§Errors
PeerError::Tls when rustls refuses the configuration, which the checks at
construction rule out.