问题描述
我已经浏览过无数帖子,但我无法弄清楚这一点。 该代码在 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 (将#修改为@)