File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3567,6 +3567,10 @@ mod _ssl {
35673567 writer
35683568 . write_all ( chunk)
35693569 . map_err ( |e| vm. new_os_error ( format ! ( "Write failed: {e}" ) ) ) ?;
3570+ // Flush to ensure data is converted to TLS records
3571+ writer
3572+ . flush ( )
3573+ . map_err ( |e| vm. new_os_error ( format ! ( "Flush failed: {e}" ) ) ) ?;
35703574 }
35713575
35723576 written = chunk_end;
@@ -3909,6 +3913,10 @@ mod _ssl {
39093913
39103914 // Step 1: Send our close_notify if not already sent
39113915 if current_state == ShutdownState :: NotStarted {
3916+ // First, flush any pending TLS data BEFORE sending close_notify
3917+ // This ensures all application data is sent before the shutdown alert
3918+ self . flush_pending_tls_output ( vm) ?;
3919+
39123920 conn. send_close_notify ( ) ;
39133921
39143922 // Write close_notify to outgoing buffer/BIO
You can’t perform that action at this time.
0 commit comments