c# – .NET和MySQL错误 – 对SSPI的调用失败……“收到的消息是
发布时间:2020-12-15 07:42:40 所属栏目:百科 来源:网络整理
导读:我希望这个问题不是太模糊,但我看得很远但却找不到任何有用的错误. 我有一个.NET 4.5.2 Web服务层(使用ServiceStack和Dapper),自从我们部署服务以来,它几乎没有收到这两个错误. 第一个错误: 2017-09-29 18:13:26.637 +00:00 [Error] Class: "TokenRepositor
我希望这个问题不是太模糊,但我看得很远但却找不到任何有用的错误.
我有一个.NET 4.5.2 Web服务层(使用ServiceStack和Dapper),自从我们部署服务以来,它几乎没有收到这两个错误. 第一个错误: 2017-09-29 18:13:26.637 +00:00 [Error] Class: "TokenRepository" | Method: "GetToken" System.Security.Authentication.AuthenticationException: A call to SSPI failed,see inner exception. ---> System.ComponentModel.Win32Exception: The message received was unexpected or badly formatted --- End of inner exception stack trace --- at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message,AsyncProtocolRequest asyncRequest,Exception exception) 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.ProcessReceivedBlob(Byte[] buffer,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst,Byte[] buffer,AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) at MySql.Data.MySqlClient.NativeDriver.StartSSL() at MySql.Data.MySqlClient.NativeDriver.Open() at MySql.Data.MySqlClient.Driver.Open() at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() at MySql.Data.MySqlClient.MySqlPool.GetConnection() at MySql.Data.MySqlClient.MySqlConnection.Open() at Dapper.SqlMapper.<QueryImpl>d__125`1.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at Dapper.SqlMapper.Query[T](IDbConnection cnn,String sql,Object param,IDbTransaction transaction,Boolean buffered,Nullable`1 commandTimeout,Nullable`1 commandType) at myApp.Services.Data.Impl.TokenRepository.GetToken(String token) in E:JenkinsworkspacemyAppsrcServices.DataImplTokenRepository.cs:line 191 第二个…… 2017-09-19 15:40:51.040 +00:00 [Error] Class: "myApp.Services.Data.Impl.SystemRepository" | Method: "GetAttributes" System.Security.Authentication.AuthenticationException: A call to SSPI failed,see inner exception. ---> System.ComponentModel.Win32Exception: The buffers supplied to a function was too small --- End of inner exception stack trace --- at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message,Nullable`1 commandType) at myApp.Services.Data.Impl.SystemRepository.GetAttributes() in E:JenkinsworkspacemyAppsrcServices.DataImplSystemRepository.cs:line 38 我的堆栈上有一点背景: > .NET 4.5.2 我们在任何其他环境中都没有收到此错误,我们没有运行Aurora,只是在Amazon RDS上运行MySQL 5.7.17. 正如我所提到的,这些错误是偶发的,并不总是发生在相同的方法/服务上,但它们总是在使用Dapper从服务层到MySQL数据库执行SQL命令时发生. 有没有进一步调试这个或者是否有任何与MySql / Aurora / Dapper相关的已知问题?经过研究,我找不到任何东西. 解决方法
看看这个
https://github.com/mysql-net/MySqlConnector/issues/428
我遇到了类似技术堆栈的同样错误.一个简单的解决方法是在connectionString中添加SslMode = None,它应该可以工作. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |