Flurl.Http出现Call failed. The SSL connection could not be established 错误

用了SKIT的组件做企业微信开发,本地测试正常,上传服务器后出现One or more errors occurred. (The SSL connection could not be established, see inner exception.)错误

解决办法,修改Flurl默认的httpclient

cs 复制代码
public class UntrustedCertClientFactory : DefaultHttpClientFactory
    {
        public override HttpMessageHandler CreateMessageHandler() {
            return new HttpClientHandler {
                ServerCertificateCustomValidationCallback = (a, b, c, d) => true
            };
        }
    }


FlurlHttp.Configure(settings => {
    settings.HttpClientFactory = new UntrustedCertClientFactory();
});

参考:

c# - Flurl and untrusted certificates - Stack Overflow

Configuration - Flurl

相关推荐
wear工程师21 小时前
接口超时别只调大 timeout:Java HTTP 客户端其实有 3 段等待
java·http
蜡台21 小时前
本机 局域网 搭建本地 HTTPS 域名完整方案
网络协议·http·https·openssl
ControlRookie1 天前
第13篇_Client 02|TCP 连接成功,为什么 HTTP 请求还没有成功
http·codesys·plc通信·controlrookie
2501_915921432 天前
抓包鹰 Traceeagle 解除证书绑定,SSL Pinning 解除
网络·网络协议·网络安全·ios·adb·https·ssl
Lucky_Turtle2 天前
【SSL】letsencrypt域名证书申请,Cloudflare域名
网络·网络协议·ssl
冠希陈、2 天前
Nginx部署SSL,导致多站点串站问题
运维·nginx·ssl
qetfw2 天前
Debian OpenSSL CA 证书配置参考:根证书、服务证书与验证
linux·debian·ssl·openssl
IPdodo跨境网络2 天前
HTTP 与 SOCKS5 代理到底差在哪?用 Node.js 跑一次连接链路对比
http
聚美智数2 天前
SSL证书信息查询-SSL域名解析-SSL证书查询服务-SSL证书解析服务API接口介绍
网络·网络协议·ssl
小小龙学IT2 天前
gRPC 开源高性能 RPC 框架深度解析:从 HTTP/2 到跨语言微服务实战
http·rpc·开源