0

我有一个 .NET 2.0 应用程序,它使用 WSE 3.0 通过 SSL 进行 Web 服务调用。在我应用了此处解释的注册表修复程序后,该应用程序在 Windows XP 上运行良好。

该修复程序使用 UseScsvForTls 条目 DWORD 值和以下注册表路径中的非零值来发送 SCSV 以在 TLS 中发出信号:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurityProviders\SCHANNEL

当我尝试在 Windows 7 机器上运行相同的应用程序(没有任何注册表修复)时,我收到以下错误:

The underlying connection was closed: An unexpected error occurred on a send.-   at        System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)

at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)

at Microsoft.Web.Services3.WebServicesClientProtocol.GetResponse(WebRequest request, IAsyncResult result)

at Microsoft.Web.Services3.WebServicesClientProtocol.GetWebResponse(WebRequest request)

at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)  

我的问题是:我可以在 Windows 7 上使用注册表修复程序来修复此错误吗?还是 Windows 7 不支持 WSE?

4

1 回答 1

2

事实证明,这个问题确实与 XP 上需要修复注册表的问题相似。我使用 Wireshark 检查 SSL 请求和响应。所以事实证明,我正在调用的 Web 服务使用的是旧版本的 SSL(版本 3.0),Windows 7 默认不再支持该版本。

修复方法是添加这行代码来强制客户端使用 SSLv3:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
于 2010-11-19T16:54:33.513 回答