.netcore3 HttpClientFactory centos7上 请求微信接口报错

An unhandled exception has occurred while executing the request.
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.
at System.Net.Security.SslStream.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception)

 

方案1

export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0;dotnet 你的项目.dll

方案2

在发布后的目录中找到"你的项目.runtimeconfig.json"配置加入

 "System.Net.Http.UseSocketsHttpHandler": false

  .netcore3 HttpClientFactory centos7上 请求微信接口报错

 

.netcore3 HttpClientFactory centos7上 请求微信接口报错

上一篇:小程序配置,通用域名配置文件


下一篇:修改WAL文件大小的2种方式