SapientGuardian / mysql-connector-net-netstandard

ADO.NET driver for MySQL targeted against netstandard 1.3
GNU General Public License v2.0
46 stars 15 forks source link

Bad Handshake #15

Closed Neerajvisma closed 8 years ago

Neerajvisma commented 8 years ago

Hi,

I am using "MicroLite": "6.2.9" in dotNETCore RC2. I get a "bad Handshake" error on MySqlConnection.Open(). It works fine for localhost but I get this error when I try to connect to a MySql instanhce hosted on AWS.

Please note that I am able to connect to this instance through MySql work-bench.

Thanks!

Neerajvisma commented 8 years ago

Sorry I mean "MySql.Data": "6.9.8-rc2-006", and not "Microlite".

eByte23 commented 8 years ago

Hi @Neerajvisma,

Can you provide more details around your app. E.g. The .net version you are targeting and auth type used.

What environment e.g. Windows or Linux mac etc

Neerajvisma commented 8 years ago

Hi,

I am using .NETCoreApp rc2. My project.json contains:-

"Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-rc2-3002702" },

AND

"frameworks": { "netcoreapp1.0": { "imports": [ "dotnet5.6", "dnxcore50", "portable-net45+win8" ] } },

At the moment I am running on a Windows machine. But ultimately, I plan to move to a linux docker environment.

We are using User ID and Password to authenticate the MySql user.

eByte23 commented 8 years ago

Thanks for the details!

I have just spooled up a mysql instance on aws to see if I can repro now...

Thanks!

eByte23 commented 8 years ago

Okay I can repro the issue, I am getting 'Authentication Failure' as the exception though. But I run the exact same code in .net 4.5.1 in in standard MySql lib and it works so definitely a bug.

I'll jump on it see if I can work out what is going on.

SapientGuardian commented 8 years ago

@eByte23 sounds like you've got this well in hand, but just a couple quick thoughts:

I assume you're both using RDS, as opposed to Aurora or your own MySQL instance on EC2?

First thing I would check is the authentication method. If that isn't obviously different from the usual setup, then we probably need a packet capture of the connection process using our library and a comparison capture from the official client.

I've got MySQL RDS instances already spun up in AWS, let me know if you need a hand.

eByte23 commented 8 years ago

Hey @SapientGuardian!,

I have spun up a standard MySql RDS instance, not Aurora. I will debug through the whole connection to see what's wrong, yes I'll check the auth method first. And just see how we go from there.

I'm thinking it could possibly have something to do with the dns look up as I have tested only with ip and local host.

Neerajvisma commented 8 years ago

Hi,

I have tried both Aurora as well as MySql RDS, and in both cases I get 'Authentication Exception' and the inner exception is 'Bad Handshake'.

Looks like @eByte23 has re-produced the exact same error. Looking forward to hear about the solution.

eByte23 commented 8 years ago

Annnnnnnnnnnnnnnnnnnnd fixed. We(probably I) had left the SSL connection stuff out because it wasn't supported in winrt but it most certainly is in dotnetcore.

Will pr shortly

SapientGuardian commented 8 years ago

@Neerajvisma can you please confirm that 6.9.8-rc2-007 resolves the issue, and close if so?

Neerajvisma commented 8 years ago

Hi @eByte23 , @SapientGuardian , thank you very much for your quick help. I have done some basic testing and can confirm that the issue is resolved.