偶尔遇到的“The request was aborted:Could not create SSL/TLS secure channel.”怎么解决?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了偶尔遇到的“The request was aborted:Could not create SSL/TLS secure channel.”怎么解决?相关的知识,希望对你有一定的参考价值。

if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))///https请求
{
    ServicePointManager.Expect100Continue = true;
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; //SSL3协议替换成TLS协议
    ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
    webRequest = WebRequest.Create(url) as HttpWebRequest;
    webRequest.ProtocolVersion = HttpVersion.Version10;
}
else
{
    webRequest = WebRequest.Create(url) as HttpWebRequest;
}

以上是关于偶尔遇到的“The request was aborted:Could not create SSL/TLS secure channel.”怎么解决?的主要内容,如果未能解决你的问题,请参考以下文章

AsyncTask *偶尔*遇到连接超时/错误问题、潜在的内存泄漏或 Android Studio 错误?

在使用clickhouse-jdbc的时候,查询数据的时候偶尔会遇到这个错误,不知道是啥原因?

Python中偶尔遇到的细节疑问:去除列名特殊字符标准差出现nan切片索引可超出范围range步长

MySQL 查询非常慢 - 偶尔

偶尔遇到的“The request was aborted:Could not create SSL/TLS secure channel.”怎么解决?

indexPathForItemAtPoint 偶尔返回 nil