Search code examples
c#mysqlmysql.data

The handshake failed due to an unexpected packet format when updating MySql.Data 8.0.26


I have a dependency on MySql.Data in my C# netcoreapp2.1 test project which I use to query for test data from a database, this works fine with v8.0.25, but if I upgrade to v.8.0.26 I get the following error (without any other code changes).

System.TypeInitializationException : The type initializer for 'Dev.Tests.Foo' threw an exception.
----> MySql.Data.MySqlClient.MySqlException : SSL Connection error.
----> System.AggregateException : One or more errors occurred. (The handshake failed due to an unexpected packet format.)
----> System.IO.IOException : The handshake failed due to an unexpected packet format.

I've tried looking in the release notes for anything that might have changed in this release to do this but can't see anything obvious (to me anyway).

Has anyone else had this issue upgrading MySql.Data?


Solution

  • If your host doesn't support SSL you can use SSL Mode options, None or Required.

    Connection string must be contain this option like;

    "..OTHER_OPTIONS..;SSL Mode=None"