C#使用HttpClient访问https请求被中止: 未能创建 SSL/TLS 安全通道(Could not create SSL/TLS secure channel)。
添加回调:
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(CheckValidationCallback);
还不行, 添加: ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
private bool CheckValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
}
转载请注明:清风亦平凡 » C#访问https “未能创建 SSL/TLS 安全通道”异常