作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用Visual Studio 2017和.NET Core 2.x.我已经建立了两个项目。第一个是后端API(https://localhost:51637)。第二个是前端网站(https://localhost:54146)。前端网站调用后端API。它们都在我的计算机上本地运行。
问题是,当前端尝试向API发送请求时,我得到了这个证据
info: Microsoft.AspNetCore.Server.Kestrel[20]
Connection id "0HLKNTHFLCEA9" request processing ended abnormally.
System.IO.IOException: The decryption operation failed, see inner exception. ---> System.ComponentModel.Win32Exception: An unknown error occurred while processing the certificate
--- End of inner exception stack trace ---
at System.Net.Security.SslStreamInternal.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer)
at Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal.AdaptedPipeline.ReadInputAsync(Stream stream)
at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.BeginRead(ValueTask`1& awaitable)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequestsAsync[TContext](IHttpApplication`1 application)
最佳答案
在开发中的两个.NET Core应用程序(其中.NET应用程序是您的自托管网站或API,而另一个是.NET客户端控制台应用程序或其他应用程序)之间,也可能会发生此错误。
服务器端错误与上述OP转储相同,客户端错误为:
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
dotnet dev-certs https -t -v
关于api - 解密操作失败,请参阅内部异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54805869/
我是一名优秀的程序员,十分优秀!