我有以下解决方案:
Windows服务中托管的WCF服务 WCF配置为使用TCP
更新Windows Server后,我从我的代码收到此错误:
System.Security.Authentication.AuthenticationException
A call to SSPI failed, see inner exception.
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost)
at Counterpoint.Irina.Services.ServerConnector.ConnectorBaseSsl..ctor(String ipServer, Int32 port) in
---------- Inner Exception ----------
System.ComponentModel.Win32Exception
One or more of the parameters passed to the function was invalid
我的程序在C#中,我以这种方式使用带有SslStream的TcpClient:
_connection = new TcpClient(ipServer, port);
sslStream = new SslStream(_connection.GetStream(), false, new RemoteCertificateValidationCallback(CertificateReceived));
sslStream.AuthenticateAsClient(ipServer);
这是RemoteCertificate的代码
// The following method is invoked by the RemoteCertificateValidationDelegate.
// This allows you to check the certificate and accept or reject it
// return true will accept the certificate
private static bool CertificateReceived(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
}
更新
eventviewver上的错误是 “生成了以下致命警报:40。内部错误状态为808。”
更新2
问题是更新KG3172605 https://support.microsoft.com/it-it/kb/3172605
请帮助:)