码迷,mamicode.com
首页 > 微信 > 详细

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

时间:2019-12-31 18:32:37      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:led   hand   div   ida   tor   img   技术   proc   patch   

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上 请求微信接口报错

标签:led   hand   div   ida   tor   img   技术   proc   patch   

原文地址:https://www.cnblogs.com/liutietuo/p/12125725.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!