Skip to content

Reject unexpected transport EOF in SslStream - #138141

Open
rzikm wants to merge 2 commits into
dotnet:mainfrom
rzikm:rzikm/sslstream-transport-eof
Open

rzikm wants to merge 2 commits into
dotnet:mainfrom
rzikm:rzikm/sslstream-transport-eof

Conversation

@rzikm

@rzikm rzikm commented Nov 23, 2026

Copy link
Copy Markdown
Member

A transport EOF between TLS records currently looks like a graceful TLS shutdown, allowing truncated streams to be accepted. Throw IOException when the shared SslStream read path reaches EOF without receiving close_notify, while preserving normal EOF after the alert.

Add regressions for abrupt EOF, buffered data, read modes, graceful shutdown, and close-delimited HTTPS responses. Update dependent stream and HTTP tests to send a TLS close alert when they expect a graceful EOF.

Validation

  • Windows: System.Net.Security build, functional tests excluding affected NegotiateStream classes, and unit tests passed. Seven NegotiateStream failures were reproduced against the unchanged baseline.
  • Windows: System.Net.Http functional and unit tests passed. The new SslStream and HTTPS regressions fail without the fix and pass with it.
  • Linux: the isolated baseline failed during CMake configuration, so tests were not run. Apple and Android were not tested. Apple's separate Network.framework path is unchanged; its clean-close/EOF race remains unverified.

Relates to #138134

Note

This description was generated with GitHub Copilot.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants