有两方面可以解决这个问题:如果您的IIS中安装了AppFabric或类似的东西,您可以开始为您的服务编写跟踪文件。这应该给你一个很好的图片什么在服务器端出错了。
在客户端,在不触摸服务器的情况下,您可能想要检查.NET是否愿意提供更多的具体错误,而不是“安全性无法正常工作”。尝试编写一个调用您的服务的控制台应用程序,并检查那里的SSL错误。
namespace ServiceTestConsole
{
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
internal class Program
{
internal static void Main()
{
ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
// add a service reference and call your service here
Console.WriteLine("Press any key to continue");
Console.ReadKey();
}
private static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslpolicyerrors)
{
Console.WriteLine("SSL Policy Error(s): " + sslpolicyerrors);
return true;
}
}
}