在 .NET 4.0 中使用 Web 服务时出现连接错误 [英] Connection Error while consuming the webservice in .NET 4.0

查看:68
本文介绍了在 .NET 4.0 中使用 Web 服务时出现连接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 .net framework 4.0 中开发了一个 .net web 服务,并部署在 widows server 2008 R2 中.客户可以毫无问题地使用 Web 服务.最近我们将 SSL 证书协议从 SSL 3.0 升级到 TLS 1.2.我的协议升级后,客户无法使用网络服务.我浏览了一些论坛,发现 .net 4.0 不支持 TLS 1.2 协议,所以任何人都可以提出最好的解决方案来克服这个问题而不升级 .NET 框架吗?

I developed a .net web service in .net framework 4.0 and deployed in widows server 2008 R2. Customers are able to consume the web service without any issues. Recently we upgraded the SSL certificate protocol from SSL 3.0 to TLS 1.2. The customers are unable to consume the web service after my protocol upgrade. I gone through some forums i found .net 4.0 doesn't support TLS 1.2 protocol so can anyone suggest the best solution to overcome this without upgrading the .NET framework?

推荐答案

TLS 1.2 默认不支持 .Net 4.0,但是,您可以更新您的在 .Net 4.0 上使用 .Net 4.5 的消费者,之后您可以使用 TLS 1.2 没有任何错误:

TLS 1.2 isn't supported by default on .Net 4.0, however, you can update your consumers with .Net 4.5 over the .Net 4.0, after that you can use TLS 1.2 without any errors:

// will not work on .Net 4.0, but will work after update to .Net 4.5
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;

如果更新不是一个选项,则必须为 .Net 4.0 使用两个选项 - SSL 3.0TLS 1.0

If the update is not an option, you have to use two options for .Net 4.0 - SSL 3.0 or TLS 1.0

这篇关于在 .NET 4.0 中使用 Web 服务时出现连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆