aspnet / KestrelHttpServer

[Archived] A cross platform web server for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
2.63k stars 528 forks source link

Fail: Uncaught exception from the PrepareRequest method of an IAdaptedConnection #1693

Closed danroth27 closed 7 years ago

danroth27 commented 7 years ago

When trying out SSL in ASP.NET Core I see the following in the logging output:

fail: Microsoft.AspNetCore.Server.Kestrel[0]
      Uncaught exception from the PrepareRequest method of an IAdaptedConnection.
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'SslStream'.
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Net.Security.SslState.CheckThrow(Boolean authSuccessCheck, Boolean shutdownCheck)
   at System.Net.Security.SslStream.get_RemoteCertificate()
   at Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapter.HttpsAdaptedConnection.PrepareRequest(IFeatureCollection requestFeatures)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame.Reset()

Sample app here: https://github.com/danroth27/active-directory-dotnet-webapp-openidconnect-aspnetcore-b2c/tree/danroth27/aspnetcore2

halter73 commented 7 years ago

1786 fixes this for 2.0.0-preview1. I did git merge -s ours rel/2.0.0-preview1 so this fix is not in dev yet. That is waiting on #1776.

davidfowl commented 7 years ago

Moved this to preview2