本文介绍了.NET HttpWebRequest HTTPS错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我正在尝试从https网页获取数据(我不在防火墙或代理服务器后面),但是即使接受所有持续投入的证书 System.Net.WebExceptionStatus.SecureChannelFailure
显示消息:取消请求:无法创建安全的SSL / TLS频道
...我到处都是,所以你们是我的最后一次机会。
Hello I'm trying to fetch data from a https web (i'm not behind firewall or proxy) however even accepting all certificates it keeps throwing System.Net.WebExceptionStatus.SecureChannelFailure
with the message shown: Cancelled the request: Unable to create a secure SSL/TLS channel... i've looked everywhere so you guys are my last chance.
static void Main(string[] args)
{
RemoteCertificateValidationCallback ServerCertificateValidationCallback = delegate { return true; };
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://miyoigo.yoigo.com");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
Console.Write(reader.ReadToEnd());
}
}
提前致谢;)
推荐答案
我已经解决了我的问题:
I have resolved my problem looking at:How do you get a System.Web.HttpWebRequest object to use SSL 2.0?
这篇关于.NET HttpWebRequest HTTPS错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!