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

相关推荐
学代码的真由酱1 天前
HTTPS
网络协议·http·https
W.A委员会1 天前
常见网络攻击
网络·http·网络安全
思麟呀1 天前
应用层协议HTTP
linux·服务器·网络·c++·网络协议·http
pengyi8710151 天前
共享IP使用基础注意事项,从源头降低关联风险
网络·网络协议·tcp/ip·安全·http
思麟呀1 天前
HTTP的Cookie和Session
linux·网络·c++·网络协议·http
PinTrust SSL证书1 天前
Geotrust企业型OV通配符SSL
网络协议·网络安全·小程序·https·云计算·ssl
EdmundXjs1 天前
Claude+qwen3-vl:8B HTTP交互信息解释
http·claude·ollama·qwen3
pengyi8710152 天前
HTTP代理连接异常排查,快速解决卡顿、断连问题
网络·网络协议·http
墨香幽梦客2 天前
全站HTTPS化实战:SSL证书管理、自动续期与TLS 1.3性能优化详解
性能优化·https·ssl
我叫张土豆2 天前
从 SSE 到 Streamable HTTP:AI 时代的协议演进之路
人工智能·网络协议·http