Function end [src]
Sends a close_notify alert, which is necessary for the server to
distinguish between a properly finished TLS session, or a truncation
attack.
Prototype
pub fn end(c: *Client) Writer.Error!void
Parameters
c: *Client
Source
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);
}