安装 VS 2015 Update 3 后,向 Web API 部署 IIS Express 发送 HTTPS 请求导致 SocketException

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

我有一个桌面客户端向 Visual Studio IIS Express 环境中托管的 Web 服务器发出 HTTPS 请求。我已经使用 VS 2015 Update 2 进行开发几个月了,一切都没有问题。

但是,昨天我安装了 VS 2015 Update 3。 首先,我必须在我的计算机上安装本地颁发的 SSL 证书(我很确定我不必使用 Update 2 执行此操作)。但是一旦解决了这个问题,一切就都很好了。

当我今天打开我的机器并加载我的开发环境时,我在发送 HTTPS 请求时收到以下异常链:

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

除了将 Resharper 从 9.2 升级到 2016.1 之外,我没有对我的开发环境进行任何其他更改,但我无法想象这与我的问题有任何关系。

有谁知道是什么导致了我的问题?

更新:

如果我不使用 SSL,我不会收到异常。 Visual Studio 2015 Update 3 使用的 IIS Express 似乎发生了一些变化,这导致了一些 SSL 问题。

我不知道 IIS Express,但我在 IIS 上遇到过同样的问题。事实证明,证书在 Update 3 安装期间与 https 绑定解除链接,我不得不通过选择 IIS Express 开发证书重新启用它。

Another answer may perhaps lead you in the right direction 关于 IIS Express。

我的问题似乎是由于将新的 IIS Express 10.0 自签名 SSL 证书添加为可信证书的方法不正确造成的。

在这个博客 post 中关注 "Resolution Number #1" 为我解决了这个问题:https://blogs.msdn.microsoft.com/robert_mcmurray/2013/11/15/how-to-trust-the-iis-express-self-signed-certificate/

我在 Visual Studio 2015 Update 3 中遇到了同样的问题,并通过修复程序和功能(或 Add/Remove 程序)中的 IIS Express 10.0 修复了它。