2017-04-21 68 views
2

我有一個ASP.NET 1.1的核心應用程序設置爲使用HTTPS和要求客戶端證書:ASP.NET核心紅隼在Linux從不提示進行客戶證書

Application Main Code

我運行的應用程序Linux操作系統。

如果我將ClientCertificateMode更改爲「AllowCertificates」,那麼一切正常,但瀏覽器從不提示客戶端證書。

設置了「RequireCertificate」,我仍然沒有得到瀏覽器提示的證書,並且我在服務器端獲得了下面兩個例外(兩個重複四次),並且沒有任何響應返回瀏覽器:

Microsoft.AspNetCore.Server.Kestrel:錯誤:ConnectionFilter.OnConnection

System.AggregateException:出現一個或多個錯誤。 (由於遠程方已關閉傳輸流,認證失敗。)---> System.IO.IOException:由於遠程方已關閉傳輸流,認證失敗。 在System.Net.Security.SslState.StartReadFrame(字節[]緩衝液,的Int32的ReadBytes,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest) ---從先前的位置,其中堆棧跟蹤結束異常被拋出--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) 在System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult的結果) 在System.Net.Security.SslStream.EndAuthenticateAsServer(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory 1.FromAsyncCoreLogic(IAsyncResult iar, Func 2 endFunction,Action 1 endAction, Task 1 promise,Boolean requ iresSynchronization) ---在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 從先前的位置堆棧跟蹤,其中引發異常--- 結束在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任務task) 在Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionFilter.d__3.MoveNext() ---內部異常堆棧跟蹤結束--- --->(內部異常#0)System.IO.IOException:身份驗證失敗,因爲遠程方關閉了傳輸流。 at System.Net.Security.SslState.StartReadFrame(Byte [] buffer,Int32 readBytes,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest) ---上一個位置的堆棧跟蹤結束位置異常被拋出--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) 在System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult的結果) 在System.Net.Security.SslStream.EndAuthenticateAsServer(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory 1.FromAsyncCoreLogic(IAsyncResult iar, Func 2 endFunction,Action 1 endAction, Task 1 promise,Boolean requ iresSynchronization) ---在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 從先前的位置堆棧跟蹤,其中引發異常--- 結束在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任務task) 在Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionFilter.d__3。的MoveNext()< ---

Microsoft.AspNetCore.Server.Kestrel:錯誤:ConnectionFilter.OnConnection

System.AggregateException:出現一個或多個錯誤。 (根據驗證過程,遠程證書無效。)---> System.Security.Authentication.AuthenticationException:根據驗證過程,遠程證書無效。 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken消息,AsyncProtocolRequest asyncRequest,ExceptionDispatchInfo除外) 在System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken消息,AsyncProtocolRequest AsyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte [] incoming,Int32 count,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte [] buffer,Int32 count,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte [] buffer,Int32 readBytes,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte [] buffer,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken消息,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.StartSendBlob(字節[]來電,的Int32計數,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState .ProcessReceivedBlob(字節[]緩衝液,計數的Int32,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.StartReadFrame(字節[]緩衝液,的Int32的ReadBytes,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.StartReceiveBlob(字節[] buffer,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte [] incoming,Int32 count,AsyncProtocolRe任務asyncRequest) 在System.Net.Security.SslState.ProcessReceivedBlob(字節[]緩衝液,計數的Int32,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.StartReadFrame(字節[]緩衝液,的Int32的ReadBytes,AsyncProtocolRequest asyncRequest) System.Net.Security.SslState.StartSendBlob(Byte [] buffer,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte []傳入,Int32計數,AsyncProtocolRequest異步請求) at System.Net.Security.SslState.ProcessReceivedBlob(Byte [] buffer,Int32 count,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte [] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest) ---從先前的位置堆棧跟蹤的結束,其中引發異常--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) 在System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult的結果) 在System.Net.Security.SslStream.EndAuthenticateAsServer(IAsyncResult的asyncResult) 在的System.Threading。 Tasks.TaskFactory 1.FromAsyncCoreLogic(IAsyncResult iar, Func 2 endFunction,Action 1 endAction, Task 1諾言,布爾需要同步) ---從前一個位置的堆棧跟蹤結束除了離子被拋出--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任務task) 在Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionFilter.d__3。MoveNext() ---內部異常堆棧跟蹤結束--- --->(內部異常#0)System.Security.Authentication.AuthenticationException:根據驗證過程,遠程證書無效。 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken消息,AsyncProtocolRequest asyncRequest,ExceptionDispatchInfo除外) 在System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken消息,AsyncProtocolRequest AsyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte [] incoming,Int32 count,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte [] buffer,Int32 count,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte [] buffer,Int32 readBytes,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte [] buffer,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken消息,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.StartSendBlob(字節[]來電,的Int32計數,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState .ProcessReceivedBlob(字節[]緩衝液,計數的Int32,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.StartReadFrame(字節[]緩衝液,的Int32的ReadBytes,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.StartReceiveBlob(字節[] buffer,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte [] incoming,Int32 count,AsyncProtocolRe任務asyncRequest) 在System.Net.Security.SslState.ProcessReceivedBlob(字節[]緩衝液,計數的Int32,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.StartReadFrame(字節[]緩衝液,的Int32的ReadBytes,AsyncProtocolRequest asyncRequest) System.Net.Security.SslState.StartSendBlob(Byte [] buffer,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte []傳入,Int32計數,AsyncProtocolRequest異步請求) at System.Net.Security.SslState.ProcessReceivedBlob(Byte [] buffer,Int32 count,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte [] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest) ---從先前的位置堆棧跟蹤的結束,其中引發異常--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) 在System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult的結果) 在System.Net.Security.SslStream.EndAuthenticateAsServer(IAsyncResult的asyncResult) 在的System.Threading。 Tasks.TaskFactory 1.FromAsyncCoreLogic(IAsyncResult iar, Func 2 endFunction,Action 1 endAction, Task 1諾言,布爾需要同步) ---從前一個位置的堆棧跟蹤結束除了離子被拋出--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任務task) 在Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionFilter.d__3。的MoveNext()< ---

Browser Screenshot

我花了大約四個小時嘗試不同的事物和周圍的Googling,但我似乎無法找出問題的核心原因,因此認爲我會檢查是否有人在這裏有一個想法。

回答

0

不知道你是否找到了解決方案,但我最近遇到了類似的問題。我發現如果您沒有任何由服務器信任的CA簽名的客戶端證書,您將不會收到提示。我的解決方案是將根CA添加到Linux中的信任存儲中,然後客戶端證書將被正確發送/提示。

0

我最終使用IIS作爲反向代理來獲取證書信息(並進行驗證),然後將它傳遞給Kestrel。