本文主要是介绍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
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
这篇关于Flurl.Http出现Call failed. The SSL connection could not be established 错误的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!