WCF分布式开发常见错误(26)2011-06-18 博客园 frank_xlWCF分布式开发常见错误(26):Authentication failed because the remote party has closed the transport stream.这个也是WCF分布式安全开发实践过程里常见的错误。 验证失败,因为远端已经关闭传输流。WCF 传输安全模式下,客户端和服务器端使用证书进行验证。WSHttpBinding.启动服务宿主程序。在进行客户端添加服务引用的时候遇到的错误。导致客户端无法添加服务元数据引用。这个问题我查找完毕后解决了。现在整理一下好给大家参考。【1】错误信息:There was an error downloading "https://frank-xu2009:8001/mex".The underlying connection was closed: An unexpected error occurred on a send.Authentication failed because the remote party has closed the transport stream.Metadata contains a reference that cannot be resolved: "https://frank-xu2009:8001/mex".An error occurred while making the HTTP request to https://frank-xu2009:8001/mex.This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.The underlying connection was closed: An unexpected error occurred on a send.Authentication failed because the remote party has closed the transport stream.If the service is defined in the current solution, try building the solution and adding the service reference again.【2】中文翻译:从"https://frank-xu2009:8001/mex"下载时出现错误。基础连接关闭:一个意外错误发生在发送时。验证失败因为远端关闭了传输流。元数据包含的引用不能解析"https://frank-xu2009:8001/mex",当向https://frank-xu2009:8001/mex发送HTTP请求的时候出现错误。这个可能是由于服务器证书没有与HTTP.SYS正确配置。这个可能是由于客户端和服务端之间的绑定不匹配所致,基础连接关闭:一个意外错误发生在发送时。验证失败因为远端关闭了传输流。 如果服务业在此解决方案里定义,请编译此解决方案然后重新添加服务引用。【3】问题分析:和这个问题的解决方式一样:http://social.microsoft.com/Forums/zh-CN/wcfzhchs/thread/54450aa5-27c8-480b-bcfb-e51f7a1e9e35。主要还是证书的设置不对。客户端提供的证书出错。制作的客户端证书要安装到服务器证书信任的存储区。