pub fn end(c: *Client) Writer.Error!void c: *Client1009
1010
1011
1012
1013
1014
1015pub 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);
}
Sends a
close_notifyalert, which is necessary for the server to distinguish between a properly finished TLS session, or a truncation attack.