[转][C#]基础连接已经关闭 未能为 SSL/TLS 安全通道建立信任关系

来自:https://www.cnblogs.com/waw/p/8286608.html

代码部分:

static TestApplication(){
    ServicePointManager.ServerCertificateValidationCallback += RemoteCertificateValidate;
}
private static bool RemoteCertificateValidate(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
{
    //为了通过证书验证,总是返回true
    return true;
}

猜你喜欢

转载自www.cnblogs.com/z5337/p/11245441.html