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

相关推荐
奥利奥夹心脆芙4 小时前
辅助排查 HTTP 接口代码报错,实操完整案例分享
http
吠品4 小时前
一次 Nginx 报错 unexpected end of file 的排查记录
网络协议·https·ssl
代码中介商5 小时前
TLS握手全解析:从1.2到1.3的加密演进
网络·网络协议·http
Orchestrator_me5 小时前
Python pip install报SSL错误
python·ssl·pip
yuegu7776 小时前
HarmonyOS应用<节气通>开发第25篇:HTTP请求封装
网络协议·http·harmonyos
serve the people7 小时前
Elasticsearch(5) i want to monitor the es health from a http api
大数据·http·elasticsearch
Mr -老鬼8 小时前
EasyClick 入门指南:HTTP 网络请求与 API 对接实战
网络·网络协议·http·自动化·#easyclick
曲幽9 小时前
写爬虫时用了代理还被封?Python 代理的那些隐藏坑,我替你踩明白了
python·http·https·proxy·socks·requests·socks5·proxies
bellus-10 小时前
如何为OpenClaw配置HTTPS?
网络协议·http·https
曦月合一10 小时前
在 Linux 服务器上执行这些命令来导入 SSL 证书
linux·服务器·ssl