.NET & MySQL error - A call to SSPI failed ... "message received was unexpected or badly formatted" AND "buffers supplied to a function was too small" .NET & MySQL error - A call to SSPI failed ... "message received was unexpected or badly formatted" AND "buffers supplied to a function was too small" asp.net asp.net

.NET & MySQL error - A call to SSPI failed ... "message received was unexpected or badly formatted" AND "buffers supplied to a function was too small"


Check out this https://github.com/mysql-net/MySqlConnector/issues/428

I faced the same error with similar sort of tech stack. An easy fix is to add SslMode=None in your connectionString and it should work.


The second error ("The buffers supplied to a function was too small") is a known issue in the .NET framework. See https://github.com/dotnet/corefx/issues/1854.

One possible workaround is retrying the connection once upon seeing this failure. It solves the problem in the mail sending use case from the GitHub issue, at least.

For what it is worth, I've seen this issue on production systems running Windows Server 2012 R2 but not on production systems running on Windows Server 2016. So I think the underlying issue might be have been fixed inbetween those versions of Windows.