Skip to content

Commit

Permalink
Fix unclean TLS shutdown (#3191)
Browse files Browse the repository at this point in the history
* Fix dirty shutdown

* generic comment
  • Loading branch information
levkk committed Apr 11, 2024
1 parent 3e7aa6b commit 03926de
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sqlx-core/src/net/tls/tls_rustls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ impl<S: Socket> Socket for RustlsSocket<S> {
}

futures_util::ready!(self.poll_complete_io(cx))?;
self.inner.socket.poll_shutdown(cx)

// Server can close socket as soon as it receives the connection shutdown request.
// We shouldn't expect it to stick around for the TLS session to close cleanly.
// https://security.stackexchange.com/a/82034
let _ = futures_util::ready!(self.inner.socket.poll_shutdown(cx));

Poll::Ready(Ok(()))
}
}

Expand Down

0 comments on commit 03926de

Please sign in to comment.