1

Let me list specs regarding this application:

  • Windows 10 for all of us
  • Asp.net core 2.0 web app
  • We all use VS2017
  • We're using IIS Express
  • SSL is turned on for this application
  • We trust our IIS express localhost cert

During startup we do the following:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

The problem we're having is only happening to some of our team members in their localhost environment.

In a background task thread, we use the System.Net.WebClient to make a call to a different URL of our app (again, to localhost), but it results in an exception whose innermost exception message is

The client and server cannot communicate, because they do not possess a common algorithm.

We know that setting ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; fixes the problem but we need it to remain at Tls12.

This must be a setting in either IIS Express or a firewall setting or something else environmental.

Some posts on Google suggest that we install .NET 4.6+ but we all have it installed already, so that's not it.

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
IWriteApps
  • 973
  • 1
  • 13
  • 30
  • `only happening to some of our team members` So.. rebuild their environments? – Maximilian Burszley Feb 06 '19 at 20:05
  • Do you mean reinstall iis or something more drastic like reinstall an image on their machine? Because since we've been supporting multiple applications for some time I don't think the latter is an option, we're hoping it's just something like a setting in IIS Express or something – IWriteApps Feb 06 '19 at 20:11
  • What operating systems are in play? Particularly among the developers it's not working for? – Chris Pratt Feb 06 '19 at 20:17
  • Windows 10 for all of us. – IWriteApps Feb 06 '19 at 20:24
  • does the accepted answer from https://stackoverflow.com/questions/5521305/iis-express-getting-ssl-to-work help? – gilliduck Feb 06 '19 at 21:01
  • It does not, in VS the project is already set to Enable SSL and all of us can hit it from a browser using https. The problem only happens when a background task (like a keep-alive task) uses WebClient to call into itself: the WebClient throws an exception. – IWriteApps Feb 07 '19 at 14:22
  • Not sure if it's acceptable for you, but did you try to use multiple values for ServicePointManager.SecurityProtocol property. Something like this: ```ServicePointManager.SecurityProtocol = Tls | Tls11 | Tls12;``` – Victor Sharovatov Mar 20 '19 at 14:51

0 Answers0