gpt4 book ai didi

api - 解密操作失败,请参阅内部异常

转载 作者:行者123 更新时间:2023-12-03 16:30:01 24 4
gpt4 key购买 nike

我正在使用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

更多信息在这里。

https://www.hanselman.com/blog/DevelopingLocallyWithASPNETCoreUnderHTTPSSSLAndSelfSignedCerts.aspx

关于api - 解密操作失败,请参阅内部异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54805869/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com