tls: send a close_notify on close for established TLS sessions instead of just dropping the socket, so clients see a clean shutdown not a truncation error
This commit is contained in:
parent
59e18b0205
commit
d8d57511ab
2 changed files with 14 additions and 0 deletions
|
|
@ -143,6 +143,9 @@ impl TlsSession for OpensslSession {
|
|||
Some(digest.iter().map(|b| format!("{b:02x}")).collect())
|
||||
}
|
||||
fn shutdown(&mut self) {
|
||||
// best-effort TLS close_notify, then close the socket. Non-blocking, so a
|
||||
// WouldBlock just means the alert is queued — we don't wait for the peer's.
|
||||
let _ = self.0.shutdown();
|
||||
let _ = self.0.get_ref().shutdown(Shutdown::Both);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue