在远程登录时绕过SSL验证的方法

//绕过SSL验证
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);

 

public bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{ // Always accept
Console.WriteLine("accept " + certificate.GetName()); return true;
} //总是接受

posted @   瓜王  阅读(449)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示