问题
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