Connection Error while consuming the webservice in .NET 4.0

淺唱寂寞╮ 提交于 2019-12-12 04:31:39

问题


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?


回答1:


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;

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



来源:https://stackoverflow.com/questions/42844825/connection-error-while-consuming-the-webservice-in-net-4-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!