C# httpwebrequest接见HTTPS链接时碰到这个毛病,然则假如我开抓包东西,比方filddler2,则POST返回一般
毛病提醒的Message为:
基本衔接已封闭: 发送时发作毛病。
InnerException为:
从传输流收到不测的 EOF 或 0 个字节。
试了网上的N种要领,以下是本次的处理方案:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
把网上找到的处理方案列一下,没准就可以处理了你的题目
以下是网上找到的处理方案:
1. request.ProtocolVersion = HttpVersion.Version10;
2. ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
3.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
4.换个UserAgent尝尝
5.在App.config中增加以下内容:
<system.net> <settings> <httpWebRequest useUnsafeHeaderParsing="true"/> </settings> </system.net>
以上就是剖析C#httpwebrequest接见HTTPS毛病处理的要领的细致内容,更多请关注ki4网别的相干文章!