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

相关推荐
不可能的是13 小时前
前端 SSE 流式请求三种实现方案全解析
前端·http
古译汉书4 天前
【IoT死磕系列】Day 7:只传8字节怎么控机械臂?学习工业控制 CANopen 的“对象字典”(附企业级源码)
数据结构·stm32·物联网·http
赤月奇5 天前
https改为http
数据挖掘·https·ssl
21号 15 天前
Http粘包问题回顾
网络·网络协议·http
A懿轩A5 天前
【SpringBoot 快速开发】面向后端开发的 HTTP 协议详解:请求报文、响应码与常见设计规范
spring boot·http·设计规范
吧啦蹦吧5 天前
http-SNI
网络·网络协议·http
k7Cx7e5 天前
宝塔域名强制SSL和带www的方法
网络·网络协议·ssl
~kiss~5 天前
HTTP 429
网络·网络协议·http
qq_316837755 天前
使用 certbot docker镜像生成阿里云域名ssl证书
阿里云·docker·ssl
Olive5 天前
深入理解 HTTP 请求重试:不只是指数退避那么简单
http