1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/// Maximum number of reusable TLS record buffers kept per worker thread.
pub const MAX_POOLED_TLS_BUFFERS: usize = 64;
/// Initial byte size of pooled TLS incoming/outgoing record buffers (fits one max 16 KiB TLS record + overhead).
pub const TLS_RECORD_BUFFER_SIZE: usize = 18 * 1024;
/// Maximum incoming ciphertext buffer growth allowed during handshake or record framing.
pub const TLS_MAX_INCOMING_BUFFER: usize = 64 * 1024;
/// Maximum outgoing ciphertext buffer growth allowed before failing a stalled connection.
pub const TLS_MAX_OUTGOING_BUFFER: usize = 256 * 1024;
/// Maximum plaintext bytes encrypted into a single TLS record.
pub const TLS_MAX_PLAINTEXT_CHUNK: usize = 16 * 1024;
/// Size of the uninitialized stack buffer used for zero-pool single-record TLS reads.
pub const TLS_STACK_READ_BUF_SIZE: usize = 4 * 1024;
/// Failure reported if the TCP socket accepts no bytes during TLS transmission.
pub const TLS_TRANSMIT_WRITE_ZERO: &str = "tcp write zero during tls transmit";
/// Size of the stack buffer used to encrypt small TLS writes without borrowing the buffer pool.
pub const TLS_STACK_WRITE_BUF_SIZE: usize = 576;
/// Maximum consecutive empty TLS application-data records tolerated before rejecting the peer.
pub const TLS_MAX_EMPTY_APP_RECORDS: usize = 32;
/// Failure reported if a peer floods consecutive empty TLS application-data records.
pub const TLS_EMPTY_RECORDS_EXCEEDED: &str = "tls empty application records exceeded";
/// Failure reported if the outgoing TLS ciphertext buffer exceeds its safety bound.
pub const TLS_OUTGOING_BUFFER_EXCEEDED: &str = "tls outgoing buffer exceeds limit";
/// Maximum plaintext length encrypted through the stack fast path in [`TlsTransport`].
pub const TLS_STACK_WRITE_PLAINTEXT_CAP: usize = 512;
/// Failure reported if the TLS peer closes TCP without sending a `close_notify` alert.
pub const TLS_PEER_CLOSED_WITHOUT_CLOSE_NOTIFY: &str =
"tls peer closed connection without close_notify";