Struct embedded_tls::TlsConfig
source · pub struct TlsConfig<'a, CipherSuite>where
CipherSuite: TlsCipherSuite,{ /* private fields */ }
Implementations§
source§impl<'a, CipherSuite> TlsConfig<'a, CipherSuite>where
CipherSuite: TlsCipherSuite,
impl<'a, CipherSuite> TlsConfig<'a, CipherSuite>where
CipherSuite: TlsCipherSuite,
pub fn new() -> Self
sourcepub fn enable_rsa_signatures(self) -> Self
pub fn enable_rsa_signatures(self) -> Self
Enable RSA ciphers even if they might not be supported.
pub fn with_server_name(self, server_name: &'a str) -> Self
sourcepub fn with_max_fragment_length(
self,
max_fragment_length: MaxFragmentLength
) -> Self
pub fn with_max_fragment_length( self, max_fragment_length: MaxFragmentLength ) -> Self
Configures the maximum plaintext fragment size.
This option may help reduce memory size, as smaller fragment lengths require smaller read/write buffers. Note that embedded-tls does not currently use this option to fragment writes. Note that the buffers need to include some overhead over the configured fragment length.
From RFC 6066, Section 4. Maximum Fragment Length Negotiation:
Without this extension, TLS specifies a fixed maximum plaintext fragment length of 2^14 bytes. It may be desirable for constrained clients to negotiate a smaller maximum fragment length due to memory limitations or bandwidth limitations.
For example, if the negotiated length is 2^9=512, then, when using currently defined cipher suites ([…]) and null compression, the record-layer output can be at most 805 bytes: 5 bytes of headers, 512 bytes of application data, 256 bytes of padding, and 32 bytes of MAC.
sourcepub fn reset_max_fragment_length(self) -> Self
pub fn reset_max_fragment_length(self) -> Self
Resets the max fragment length to 14 bits (16384).