end
Sends a close_notify alert, which is necessary for the server to
distinguish between a properly finished TLS session, or a truncation
attack.
Function parameters
Parameters
- c:*Client
Type definitions in this namespace
Types
Initiates a TLS handshake and establishes a TLSv1.2 or TLSv1.3 session.
Functions
Error sets in this namespace
Error Sets
The `Reader` supplied to `init` requires a buffer capacity
Values
- min_buffer_len
- The `Reader` supplied to `init` requires a buffer capacity
Source
Implementation
pub fn end(c: *Client) Writer.Error!void {
try flush(&c.writer);
const output = c.output;
const ciphertext_buf = try output.writableSliceGreedy(min_buffer_len);
const prepared = prepareCiphertextRecord(c, ciphertext_buf, &tls.close_notify_alert, .alert);
output.advance(prepared.ciphertext_end);
}