Fixes #65455.
The assert was hit due to the SslStream being disposed during handshake, while `AuthenticateAsClientAsync` was still running. This removes a rare crash in test runs with debug libraries configuration.
Assert.Contains("SSL_ERROR_SSL", e.InnerException.Message);
Assert.NotNull(e.InnerException.InnerException);
Assert.Contains("protocol", e.InnerException.InnerException.Message);
+
+ e = await Assert.ThrowsAsync<AuthenticationException>(() => clientAuthenticationTask);
+
+ Assert.NotNull(e.InnerException);
+ Assert.Contains("SSL_ERROR_SSL", e.InnerException.Message);
+ Assert.NotNull(e.InnerException.InnerException);
+ Assert.Contains("protocol", e.InnerException.InnerException.Message);
}
}