.net 在osx上启动dotnet core应用程序的问题

.net 在osx上启动dotnet core应用程序的问题,.net,model-view-controller,core,kestrel,.net,Model View Controller,Core,Kestrel,出于某种奇怪的原因,我无法在osx上启动任何mvc或webapp项目 应用程序按预期使用此输出启动。 当第一个请求被传递到上面的任何地址时,我得到了这个stacktrace,我无法理解为什么因为项目刚刚创建,所以没有对代码进行任何修改 错误: fail: Microsoft.AspNetCore.Server.Kestrel[0] Uncaught exception from the OnConnectionAsync method of an IConnectionAdapter

出于某种奇怪的原因,我无法在osx上启动任何mvc或webapp项目

应用程序按预期使用此输出启动。 当第一个请求被传递到上面的任何地址时,我得到了这个stacktrace,我无法理解为什么因为项目刚刚创建,所以没有对代码进行任何修改

错误:

fail: Microsoft.AspNetCore.Server.Kestrel[0]
      Uncaught exception from the OnConnectionAsync method of an IConnectionAdapter.
System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Interop+AppleCrypto+SslException: Internal error
   --- End of inner exception stack trace ---
   at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, 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)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.Security.SslStream.BeginAuthenticateAsServer(SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken, AsyncCallback asyncCallback, Object asyncState)
   at System.Net.Security.SslStream.<>c.<AuthenticateAsServerAsync>b__51_0(SslServerAuthenticationOptions arg1, CancellationToken arg2, AsyncCallback callback, Object state)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2](Func`5 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, Object state, TaskCreationOptions creationOptions)
   at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2](Func`5 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, Object state, TaskCreationOptions creationOptions)
   at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2](Func`5 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, Object state)
   at System.Net.Security.SslStream.AuthenticateAsServerAsync(SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Https.Internal.HttpsConnectionAdapter.InnerOnConnectionAsync(ConnectionAdapterContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.HttpConnection.ApplyConnectionAdaptersAsync()
fail:Microsoft.AspNetCore.Server.Kestrel[0]
来自IConnectionAdapter的OnConnectionAsync方法的未捕获异常。
System.Security.Authentication.AuthenticationException:身份验证失败,请参阅内部异常。-->Interop+AppleCrypto+SSLexException:内部错误
---内部异常堆栈跟踪的结束---
位于System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken消息、AsyncProtocolRequest asyncRequest、ExceptionDispatchInfo异常)
在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(字节[]缓冲区,AsyncProtocolRequest asyncRequest)
位于System.Net.Security.SslState.ForceAuthentication(布尔值receiveFirst,字节[]缓冲区,AsyncProtocolRequest asyncRequest)
在System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult-lazyResult)上
位于System.Net.Security.SslStream.BeginauthenticatesServer(SslServerAuthenticationOptions SslServerAuthenticationOptions,CancellationToken CancellationToken,AsyncCallback AsyncCallback,Object asyncState)
位于System.Net.Security.SslStream.c.b_51_0(SslServerAuthenticationOptions arg1、CancellationToken arg2、AsyncCallback回调、对象状态)
在System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2](Func`5 beginMethod,Func`2 endFunction,Action`1 endAction,TArg1 arg1,TArg2 arg2,对象状态,TaskCreationOptions creationOptions)
在System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2](函数'5 beginMethod,操作'1 endMethod,TArg1 arg1,TArg2 arg2,对象状态,TaskCreationOptions creationOptions)
在System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2](Func`5 beginMethod,Action`1 endMethod,TArg1 arg1,TArg2 arg2,对象状态)
位于System.Net.Security.SslStream.AuthenticateAsServerAsync(SslServerAuthenticationOptions SslServerAuthenticationOptions,CancellationToken CancellationToken)
位于Microsoft.AspNetCore.Server.Kestrel.Https.Internal.HttpsConnectionAdapter.InnerOnConnectionAsync(ConnectionAdapterContext上下文)
位于Microsoft.AspNetCore.Server.Kestrel.Core.Internal.HttpConnection.ApplyConnectionAdaptersAsync()

请帮忙

尝试使用
dotnet dev certs https--trust
,它将信任本地证书,如果本地证书不存在,则生成本地证书。

有几个
dotnet
CLI命令修复了我的问题

我必须删除现有证书,然后生成一个新证书,如下所示:

$ sudo dotnet dev-certs https --clean
$ dotnet dev-certs https
来源于对GitHub问题的评论

$ sudo dotnet dev-certs https --clean
$ dotnet dev-certs https