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

相关推荐
喵个咪2 天前
Go-Wind HTTP 服务器从入门到精通
后端·http·go
Goodbye7 天前
大模型无状态架构:从 HTTP 协议到 Harness AI 工程的深度解析
http
霜落长河14 天前
抛弃TCP改用UDP,HTTP3怎么了?
http
程序员mine14 天前
HTTPS-TLS加密与证书完全指南(中)
网络协议·https·ssl
之歆14 天前
现代 HTTP 客户端深度解析:Fetch 与 Axios
chrome·网络协议·http
程序员mine15 天前
HTTPS-TLS加密与证书完全指南(下)
网络协议·http·https
SomeOtherTime15 天前
http协议处理播放video/mp4视频
http
开发者联盟league15 天前
pnpm install报错ERR_SSL_PACKET_LENGTH_TOO_LONG问题解决
网络·网络协议·ssl
北极熊~~15 天前
win上编译带ssl的paho-cpp库
mqtt·ssl·源码编译mqtt库
llz_11215 天前
web-第五次课后作业
前端·后端·http