New ASP.NET Core API project with Silver fails with AuthenticationException

I just restored a machine, reinstalled Elements and Water, then tried to build and run a project that previously built and ran successfully. The project used the basic ASP.NET Core API project for Silver. It now fails with

~> Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 33.3997ms 307
!> Exception of type System.Security.Authentication.AuthenticationException on thread 30C0
!> Message: Authentication failed, see inner exception.

Any ideas as to what may have changed?

Not offhand, noting has changed there puposefully, really. What’s does the the inner exception’s type/message say?

I didn’t see any inner exception message. I suspect this is something to do with TLS settings, but I’ve been unable to determine what I need to do to set that properly.

The message it does print, “Message: Authentication failed, see inner exception” lets me t believe the InnerException field on the exception object is set to a more detailed error that was wrapped by this new outer exception.

You should be sable to see it if you expand the Exception node in the Debug Inspector.

Interesting. I still don’t see an inner exception in Water, but running from Visual Studio works just fine, though I do see the insecure certificate warning. I suspect Water is running on an earlier SSL/TLS version. I’ve seen the same error before, and this was the root cause. I just cannot seem to figure out how to resolve it in Water. However, given I can use VS, I’m happy to move on.

Curious. what happens if you just ignore the exception in Water, and keep running?

Oddly, the Water debugger doesn’t do anything with TLS or certificates itself though. this is all done by the .NET Core runtime. We just launch the process and off it goes. It could be that VS just hides this exception by default?

Interesting! Looks like it fails three times, then allows me through. So it could just be that it’s detecting an insecure certificate and stopping. I tried proceeding once before, but I hadn’t tried the additional times.

I’ll add it to the list of exceptions that get ignored by default. Do you have the callstack handy? (you can get it by typing “bt” in the console, and copy it out) — I’ll make filtering the exception dependent on that.

!> Exception of type System.Security.Authentication.AuthenticationException on thread 1844
!> Message: Authentication failed, see inner exception.

#> (edb) bt
0000000000000000 , System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ( 0)
0000000000000000 , System.Net.Security.SslStream.StartSendAuthResetSignal ( 0)
0000000000000000 , System.Net.Security.SslStream.CheckCompletionBeforeNextReceive ( 0)
0000000000000000 , System.Net.Security.SslStream.StartSendBlob ( 0)
0000000000000000 , System.Net.Security.SslStream.ProcessReceivedBlob ( 0)
0000000000000000 , System.Net.Security.SslStream.StartReadFrame ( 0)
0000000000000000 , System.Net.Security.SslStream.PartialFrameCallback ( 0)
0000000000000000 , System.Net.AsyncProtocolRequest.CompleteRequest ( 0)
0000000000000000 , System.Net.FixedSizeReader/<ReadPacketAsync>d__1.MoveNext ( 0)
0000000000000000 , System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1.ExecutionContextCallback ( 0)
0000000000000000 , System.Threading.ExecutionContext.RunInternal ( 0)
0000000000000000 , System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1.MoveNext ( 0)
0000000000000000 , System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1.MoveNext ( 0)
0000000000000000 , System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction ( 0)
0000000000000000 , System.Threading.Tasks.Task.RunContinuations ( 0)
0000000000000000 , System.Threading.Tasks.Task.FinishContinuations ( 0)
0000000000000000 , System.Threading.Tasks.Task`1.TrySetResult ( 0)
0000000000000000 , System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1.SetResult ( 0)
0000000000000000 , Microsoft.AspNetCore.Server.Kestrel.Core.Internal.DuplexPipeStream/<ReadAsyncInternal>d__27.MoveNext ( 0)
0000000000000000 , System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1.ExecutionContextCallback ( 0)
0000000000000000 , System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop ( 0)
0000000000000000 , System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1.MoveNext ( 0)
0000000000000000 , System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1.ExecuteFromThreadPool ( 0)
0000000000000000 , System.Threading.ThreadPoolWorkQueue.Dispatch ( 0)
0000000000000000 , System.Threading._ThreadPoolWaitCallback.PerformWaitCallback ( 0)
0000000000000000 , [unmanaged] ( 0)
1 Like