Search code examples
asp.net-web-apihttpsvisual-studio-2015iis-express

After installing VS 2015 Update 3, sending HTTPS request to WebAPI development IIS Express causes SocketException


I have a Desktop client making HTTPS requests to a WebServer hosted in Visual Studio IIS Express environment. I have been developing using VS 2015 Update 2 for several months and things have worked without issues.

However, yesterday I installed VS 2015 Update 3. First I had to install the locally issued SSL certificate on my computer (I'm fairly certain I didn't have to do this with Update 2). But once that was out of the way, things were working fine.

When I turned on my machine today and loaded my development environment, I get the following chain of exceptions when sending the HTTPS request:

HttpRequestException: An error occurred while sending the request.

WebException: The underlying connection was closed: An Unexpected error occurred on a send.

IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

SocketException: An existing connection was forcibly closed by the remote host

I have not made any other changes to my dev environment except upgrading Resharper from 9.2 to 2016.1, but I can't imagine that having anything to do with my issues.

Does anyone have any idea what could be causing my issues?

Update:

I don't get the Exceptions if I don't use SSL. So is seems to be some change to the IIS Express used by Visual Studio 2015 Update 3 which causes some SSL issues.


Solution

  • It seems that my problem was caused by an incorrect approach to adding the new IIS Express 10.0 self signed SSL certificate as a trusted certificate.

    Following "Resolution Number #1" in this blog post solved it for me: https://blogs.msdn.microsoft.com/robert_mcmurray/2013/11/15/how-to-trust-the-iis-express-self-signed-certificate/