C# A call to SSPI failed, see inner exception - Th

2019-03-05 10:32发布

I wrote a C# program to connect MySql server with 'Mysql Connector/Net'. I use security connection with ssl option. I made the server certs and client pfx cert too properly. But when I'm trying to connect to the server I get this exepction.

    System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The Local Security Authority cannot be contacted
   --- End of inner exception stack trace ---
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, 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.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, 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)

The MySql server version (5.5) is supported by the MySql Connector/Net version what I use (6.9).

IMPORTANT: It worked in earlier Windows 10 but not in Windows 10 up-to-date. My friend tested it in Windows 7 and 8.1 with success. Maybe a Windows update messed up something.

I read here a solution: the registry must be edited, but it didn't work.

1条回答
▲ chillily
2楼-- · 2019-03-05 11:06

I encountered the same issue, I think it is related to a latest security update of windows 10. The error is gone when I change the connection string to turn of SSL encryption for my connection... EDIT: error is solved after updating mysql-server-5.5

查看更多
登录 后发表回答