SslStream/NegotiateStream should throw InvalidCredentialException when the authentication fails and cannot be retried
According to MSDN: https://msdn.microsoft.com/en-us/library/system.security.authentication.invalidcredentialexception(v=vs.110).aspx
The exception that is thrown when authentication fails for an authentication stream and cannot be retried.
At the moment SslStream is throwing only AuthenticationException.
/cc @himadrisarkar @davidsh
Next step:
- Verify Desktop behavior
- Fix MSDN or CoreFX to match the behavior (might have compat question 1.1->2.0)
In SslStream’s MSDN (https://msdn.microsoft.com/en-us/library/system.net.security.sslstream(v=vs.110).aspx)
“If the authentication fails, you receive a AuthenticationException, and the SslStream is no longer useable. You should close this object and remove all references to it so that it can be collected by the garbage collector.”
So retry authentication is not possible for SSLStream, this is the first thing we need to notice.
Second, I have tested the behavior on .Net Desktop when authentication fails. It throws AuthenticationException, same as .Net Core does.
Therefore we need to fix the MSDN instead of the code.
@schen381 which docs do we have to update? Can you please suggest new wording, then we should pass it to docs team. Thanks!
@karelz I will discuss with Cristian offline tomorrow and follow up here. Thanks!
@karelz We need to change the doc for InvalidCredentialException at https://docs.microsoft.com/en-us/dotnet/api/System.Security.Authentication.InvalidCredentialException?view=netframework-4.7, and the MSDN website will be phased out redirected to the new docs website. We need to change the Remark section and remove any occurrences of "SslStream" from it, because InvalidCredentialException only applies for NegotiateStream.
cc: @davidsh @CIPop
@mairaw is the above information actionable for docs team? Should we move the bug to docs repo now?
Thank you @schen381!
Sure, we can change the remarks to remove any mentions of SslStream from it. I'll move this issue to our repo now.
Issue moved to dotnet/docs dotnet/corefx#1941 via ZenHub