Skip to content

NegotiateStream and SslStream will no longer fail on multiple Begin operations without End #20865

Closed

Description

@wfurt

NegotiateStream and SslStream will no longer fail on multiple *Begin operations without *End

This is change in how we handle error cases on security streams.

Version introduced

5.0 RC1

Old behavior

In the past sequence of

  • BeginXx
  • BeginXx

would throw NotSupportedException exception.

New behavior

Since the API calls are now backed by Task based implementation, this is no longer the case.

Reason for change

Switching internal implementation from APM to Tasks improves performance and decreases code complexity.

Recommended action

none. It was always invalid to call multiple Begin* operations without End*.

Category

  • ASP.NET Core
  • C#
  • Code analysis
  • Core .NET libraries
  • Cryptography
  • Data
  • Debugger
  • Deployment
  • Globalization
  • Interop
  • JIT
  • LINQ
  • Managed Extensibility Framework (MEF)
  • MSBuild
  • Networking
  • Printing
  • Security
  • Serialization
  • Visual Basic
  • Windows Forms
  • Windows Presentation Foundation (WPF)
  • XML, XSLT

Affected APIs

SslStream.BeginAuthenticateAsServer
SslStream.BeginAuthenticateAsClient
NegotiateStream.BeginAuthenticateAsServer
NegotiateStream.BeginAuthenticateAsClient


Issue metadata

  • Issue type: breaking-change

cc: @stephentoub

Activity

  1. added
    breaking-change
    on Oct 1, 2020
  2. stephentoub commented on Oct 1, 2020

    @stephentoub
    Member

    They still may throw an exception, they're just not guaranteed to. The streams don't support two read operations at the same time, or two write operations at the same time, so if you call BeginXx a second time before the first has completed, it should still throw, yes?

  3. self-assigned this
    on Oct 1, 2020
  4. added
    🏁 Release: .NET 5
    on Oct 1, 2020
  5. wfurt commented on Oct 6, 2020

    @wfurt
    MemberAuthor

    yes. Calling ReadAsync twice in parallel (and that include Begin* pattern) will still throw NotSupportedException.

  6. added a commit that references this issue on Oct 8, 2020
    70a03a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 5breaking-change

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions