远程主机强行关闭连接|消费网络服务

问题描述

我已经浏览过无数帖子,但我无法弄清楚这一点。 该代码在 Web 应用程序的本地机器上运行,但在 Windows Server 2008 r2 上的共享点 2007 webpart 上运行时会引发此异常。 该代码正在尝试使用支持 tls 1.0-1.2 的网络服务。 我一直在摆弄 httpWebRequest 设置,但到目前为止没有运气。

以下是我迄今为止一直在尝试的设置:

    var httpWebRequest = (HttpWebRequest)WebRequest.Create(RequestAttributeURL);
    httpWebRequest.ContentType = "application/json";
    httpWebRequest.Method = "POST";

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
    ServicePointManager.ServerCertificateValidationCallback += (sender,certificate,chain,sslPolicyErrors) => true;
    httpWebRequest.AuthenticationLevel = AuthenticationLevel.MutualAuthRequested;
    httpWebRequest.KeepAlive = true;
    httpWebRequest.ProtocolVersion = HttpVersion.Version11;
    httpWebRequest.ServicePoint.ConnectionLimit = 24;

我坚持使用古老的 3.5 框架,因此无法进行升级。 有关如何继续调查此问题的任何帮助?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...