安装VS 2015 Update 3之后,向WebAPI开发IIS Express发送HTTPS请求会导致SocketException [英] After installing VS 2015 Update 3, sending HTTPS request to WebAPI development IIS Express causes SocketException

查看:57
本文介绍了安装VS 2015 Update 3之后,向WebAPI开发IIS Express发送HTTPS请求会导致SocketException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个桌面客户端,它向Visual Studio IIS Express环境中托管的WebServer发出HTTPS请求.我已经使用VS 2015 Update 2进行了几个月的开发,并且一切正常.

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.

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

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.

今天打开机器并加载开发环境时,发送HTTPS请求时会出现以下异常链:

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:发送请求时发生错误.

HttpRequestException: An error occurred while sending the request.

WebException:基础连接已关闭:意外发送时发生错误.

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

IOException:无法从传输连接:现有连接被强制关闭远程主机.

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

SocketException:现有连接被强制被远程主机关闭

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

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

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?

更新:

如果我不使用SSL,则不会获得例外.因此,似乎对Visual Studio 2015 Update 3使用的IIS Express进行了一些更改,这会导致一些SSL问题.

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.

推荐答案

似乎我的问题是由于将新的IIS Express 10.0自签名SSL证书添加为受信任证书的方法不正确引起的.

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.

此博客文章中的解决方案编号#1"之后为我解决了此问题:

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/

这篇关于安装VS 2015 Update 3之后,向WebAPI开发IIS Express发送HTTPS请求会导致SocketException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆