解决方法

webRequest.KeepAlive = false;
ServicePointManager.ServerCertificateValidationCallback += (s, cert, chain, sslPolicyErrors) => true;

//WebRequest请求被中止: 未能创建 SSL/TLS 安全通道  在请求之前插入TLS安全协议:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

The underlying connection was closed: An unexpected error occurred on a receive的更多相关文章

  1. 微信接口问题(The underlying connection was closed: An unexpected error occurred on a send)

    突然在调用微信接口是报:The underlying connection was closed: An unexpected error occurred on a send错误,跟踪了半天,是因为 ...

  2. The underlying connection was closed: An unexpected error occurred on a send

    操作系统是Windows Server 2003 x64 SP2,使用Framework 4.0,在使用WebClient访问某些特定的HTTPS站点时,会引发异常: Unhandled Except ...

  3. Json Post到 https的坑 - the underlying connection was closed an unexpected error occurred on a send(远程服务器未知错误导致关闭)

    最近做了一个安装包,安装包会弹出dotnet的 窗体,这个安装包会去调用https的一个api.用测试程序测试窗体都是好的.一旦打入安装包后,就报错.研究了半天,原来是https惹的祸 解决方案: . ...

  4. The underlying connection was closed: An unexpected error occurred on a rece

    服务器问题,在后台访问外网了,特别是https的网站,容易出这个问题. 修改服务器配置,或修改代码解决.

  5. Web Server 使用WebClient 发送https请求 The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel

    使用WebClient 发送https请求 使用WebClient发送请求时,并且是以https协议: WebClient webClient = new WebClient(); string re ...

  6. EX:The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

    EX:The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secu ...

  7. [WebException: The underlying connection was closed: The message length limit was exceeded.]解决方法

    [WebException: The underlying connection was closed: The message length limit was exceeded.]   Syste ...

  8. [bug]The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

    写在前面 在模拟请求的时候,如果url为https的,会报这个错误.大概错误就是:基础连接已关闭:无法建立信任关系的SSL / TLS的安全通道. The underlying connection ...

  9. windows xp .net framework 4.0 HttpWebRequest 报The underlying connection was closed,基础连接已关闭

    windows xp .net framework 4.0 HttpWebRequest 报The underlying connection was closed,基础连接已关闭,错误的解决方法 在 ...

随机推荐

  1. django+sqlite3进行web开发(一)

    服务器配置 安装django sudo apt-get install python-django -y 安装mysql(可选) 也可以直接使用sqlite sudo apt-get install ...

  2. qr.h

    创建二维码 QRCodeCreate vc++

  3. 数据结构 - 链栈的实现 C++

    链栈封装 C++ 使用C++对链栈进行了简单的封装,实现了栈的基本操作 封装方法: pop(),top(),size(),empty(),push() 代码已经过测试 #pragma once #in ...

  4. Windows中的txt文件到Mac打开是乱码 解决办法

    在Mac下打开“文本编辑”程序之后,选择菜单“文本编辑” -> “偏好设置”.2)在“偏好设置”中选择第二个标签页“打开和存储”,选择“纯文本文件编码”中的“打开文件”和“存储文件”修改成为“中 ...

  5. Python多线程采集百度相关搜索关键词

    百度相关搜索关键词抓取,读取txt关键词,导出txt关键词 #百度相关搜索关键词抓取,读取txt关键词,导出txt关键词   # -*- coding=utf-8 -*- import request ...

  6. phpcms邮箱smtp配置163企业邮测试可用

    前面我们给phpcms加了https,但是修改邮箱smtp配置一直提交不了,提示请填写接口地址,格式为:http://www.abc.com,结尾不包含"/",找了一下phpsso ...

  7. home_url()用法小结|wordpress函数

    home_url()检索可访问当前站点的URL(推荐将<?php bloginfo('url'); ?>用<?php home_url(); ?>来替代),使用适当的协议返回' ...

  8. nginx 搭建上传服务器

    nginx webdav 服务器搭建 该模块可以为Http webDAV 增加PUT,DELETE,MKCOL,COPY和MOVE等方法.模块在默认编译的情况下是不被包含的,需要指定编译 ./conf ...

  9. Sonarqube C#静态代码规范检查(一)

    使用说明 代码规范对于每个开发来说重要也重要,说不重要其实也没那么重要,简单点的vs的code analysis也能提供很多的建议,重量级一点的Resharper不仅能提供建议,还提供了更方便快捷的一 ...

  10. [KCOJ3393]上马

    题目描述 Description Chicken在IEC(International Equestrianism Competition(国际马术表演赛))惨跪,没有成功的上到马,他深刻的记得他的选手 ...