NegotiateStream and SslStream allow successive Begin operations
Error cases on security streams are handled differently, and successive calls to
BeginAuthenticateAsClient may no longer fail.
In previous .NET versions, calling
BeginAuthenticateAsClient successively without first calling
EndAuthenticateAsClient results in a NotSupportedException. Starting in .NET 5, successive calls to
BeginAuthenticateAsClient no longer result in a NotSupportedException, because these APIs are backed by a Task-based implementation.
Reason for change
Switching the internal implementation from asynchronous programming model (APM) to Task-based improves performance and decreases code complexity.
No action is required on the part of the developer.