pub trait PolicySetters: Holds<Policy> + Sized {
Show 13 methods
// Required methods
fn tls_versions(self, value: impl Into<Vec<TlsVersion>>) -> Self;
fn cipher_suites(self, value: impl Into<Option<Vec<String>>>) -> Self;
fn kx_groups(self, value: impl Into<Option<Vec<String>>>) -> Self;
fn cipher_profiles(self, value: impl Into<Vec<CipherProfile>>) -> Self;
fn crypto(self, value: impl Into<Crypto>) -> Self;
fn certificate(self, value: impl Into<CertificateType>) -> Self;
fn pin_digests(self, value: impl Into<Vec<Digest>>) -> Self;
fn check_validity(self, value: bool) -> Self;
fn allow_chain_when_pinned(self, value: bool) -> Self;
fn allow_resumption(self, value: bool) -> Self;
fn require_ems(self, value: bool) -> Self;
fn waiting(self, value: impl Into<WaitingLimits>) -> Self;
fn acl(self, value: impl Into<Option<Acl>>) -> Self;
}Expand description
The typed setters of Policy, for any builder that holds its settings.
Required Methods§
Sourcefn tls_versions(self, value: impl Into<Vec<TlsVersion>>) -> Self
fn tls_versions(self, value: impl Into<Vec<TlsVersion>>) -> Self
TLS versions offered and accepted. Non-empty.
Sourcefn cipher_suites(self, value: impl Into<Option<Vec<String>>>) -> Self
fn cipher_suites(self, value: impl Into<Option<Vec<String>>>) -> Self
An allow-list of cipher suites by IANA name, for example TLS13_AES_256_GCM_SHA384.
None allows every suite the cipher profiles give for tls_versions.
An unknown name is an error that lists the supported ones.
Sourcefn kx_groups(self, value: impl Into<Option<Vec<String>>>) -> Self
fn kx_groups(self, value: impl Into<Option<Vec<String>>>) -> Self
An allow-list of key-exchange groups by name, for example X25519; None allows all
the cipher profiles give.
Sourcefn cipher_profiles(self, value: impl Into<Vec<CipherProfile>>) -> Self
fn cipher_profiles(self, value: impl Into<Vec<CipherProfile>>) -> Self
The algorithm profiles allowed; what is offered is their union, in the order of the
first listed, narrowed by the versions, the provider, cipher_suites
and kx_groups. Every preset allows [CipherProfile::Mozilla]. Text
key cipher_profiles.
Sourcefn crypto(self, value: impl Into<Crypto>) -> Self
fn crypto(self, value: impl Into<Crypto>) -> Self
The crypto provider; Crypto::Ring in every preset. Text key crypto.
Sourcefn certificate(self, value: impl Into<CertificateType>) -> Self
fn certificate(self, value: impl Into<CertificateType>) -> Self
What peers authenticate with: CertificateType::X509 (the default in every preset) or
CertificateType::RawPublicKey. Text key certificate.
Sourcefn pin_digests(self, value: impl Into<Vec<Digest>>) -> Self
fn pin_digests(self, value: impl Into<Vec<Digest>>) -> Self
Digests a pin may use. Pins are compared in constant time whatever their digest.
Sourcefn check_validity(self, value: bool) -> Self
fn check_validity(self, value: bool) -> Self
Whether a pinned certificate must be inside its validity dates.
Sourcefn allow_chain_when_pinned(self, value: bool) -> Self
fn allow_chain_when_pinned(self, value: bool) -> Self
Whether a pinned peer may present a chain; strict refuses one.
Sourcefn allow_resumption(self, value: bool) -> Self
fn allow_resumption(self, value: bool) -> Self
Whether TLS sessions may be resumed. A resumed handshake skips the certificate
verifiers, so a peer removed from the trust store or no longer pinned can reconnect
on a session it already holds, and the access control list’s fingerprint rules are not
checked again (its address rules are). Every preset leaves it off; non_defaults reports it.
Sourcefn require_ems(self, value: bool) -> Self
fn require_ems(self, value: bool) -> Self
Whether a TLS 1.2 connection must use the extended master secret (RFC 7627). Without it
a TLS 1.2 session’s keys and exporter are not bound to its handshake, which an attacker
can use to synchronise two sessions (the triple handshake). modern and intermediate
set it; legacy does not, for TLS 1.2 stacks older than RFC 7627. TLS 1.3 needs nothing
like it.
Sourcefn waiting(self, value: impl Into<WaitingLimits>) -> Self
fn waiting(self, value: impl Into<WaitingLimits>) -> Self
The bounds of a store-backed pin set’s waiting queue: entries per source, entries in
all, and how long before the same certificate from the same source is recorded again.
In the text form a table: per_source, total and rerecord (a duration, a number of
seconds in a hand-written document).
Sourcefn acl(self, value: impl Into<Option<Acl>>) -> Self
fn acl(self, value: impl Into<Option<Acl>>) -> Self
An ordered access control list for connecting clients, applied by every server
configuration built under this policy: by address when the ClientHello arrives
(Refusal::AddressDenied) and by the client
certificate’s fingerprint before the trust store is consulted
(Refusal::PeerDenied). Its fingerprints may be written
in any spelling a PeerId parses, and are made canonical where a configuration is
built or a policy is read through serde; a
rule naming something else, or a digest other than SHA-256, is an error there and in
check. None for none.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".