wcf客户端仅在一次报告SSL异常

时间:2014-09-30 20:11:07

标签: c# asp.net wcf ssl

我们的WCF客户端通常会调用Web服务。客户端的所有部署都调用相同的Web服务。在大多数部署中,它使调用没有任何问题,除了在一个实例中它报告以下异常:

System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---

这一个装置有什么不同?

我们测试了客户端用来在浏览器中调用Web服务的URL。 Web服务在Firefox中返回响应,但在IE中没有。

2 个答案:

答案 0 :(得分:0)

你看过这篇文章了吗?它包含了解决这些问题的相当好的提示:http://blogs.msdn.com/b/jpsanders/archive/2009/09/16/troubleshooting-asp-net-the-remote-certificate-is-invalid-according-to-the-validation-procedure.aspx?Redirected=true

例如,您需要检查特定计算机是否已正确部署所有根证书和中间证书。

答案 1 :(得分:0)

我找到了解决方案 - 使用SHA256安装了新的Web服务服务器证书,Windows 2003 Server需要一个修补程序来支持它:

http://support.microsoft.com/kb/938397