Giter VIP home page Giter VIP logo

Comments (9)

osheroff avatar osheroff commented on June 26, 2024 1

Hi @redcape I got stuck yak-shaving an issue with jdk11 and tls-hostname-verifying and oh-god-it's-a-tarpit. I'll see if I can get openjdk8 running somewhere so I can get a build out sooner than later.

from mysql-binlog-connector-java.

osheroff avatar osheroff commented on June 26, 2024

from mysql-binlog-connector-java.

redcape avatar redcape commented on June 26, 2024

Had a separate conversation, thanks for being responsive @osheroff and giving me the right idea for looking into this further.

I ended up turning off TLS for a temp DB and using Wireshark which thankfully has a MySQL protocol interpeter already written to compare the differences. The failure was at the login step. The diff between logins is below. The piece that Azure wanted was specifying the Client Auth Plugin of mysql_native_password after the password and schema.

I'm not sure if this should be behind a flag or something based on the MySQL version to maintain backwards compatibility, but this is the change that works.

Change to make to AuthenticateSecurityPasswordCommand:

        buffer.writeZeroTerminatedString(username);
        byte[] passwordSHA1 = passwordCompatibleWithMySQL411(password, salt);
        buffer.writeInteger(passwordSHA1.length, 1);
        buffer.write(passwordSHA1);
        if (schema != null) {
            buffer.writeZeroTerminatedString(schema);
        }
        buffer.writeZeroTerminatedString("mysql_native_password"); // this line fixes it
        return buffer.toByteArray();

Diff between login requests:

% diff login-jdbc login-binlog 
2c2
<     Packet Length: 234
---
>     Packet Length: 75
5,7c5,7
<         Client Capabilities: 0xa207
<             .... .... .... ...1 = Long Password: Set
<             .... .... .... ..1. = Found Rows: Set
---
>         Client Capabilities: 0x8204
>             .... .... .... ...0 = Long Password: Not set
>             .... .... .... ..0. = Found Rows: Not set
19c19
<             ..1. .... .... .... = Knows about transactions: Set
---
>             ..0. .... .... .... = Knows about transactions: Not set
22c22
<         Extended Client Capabilities: 0x003e
---
>         Extended Client Capabilities: 0x0008
24,25c24,25
<             .... .... .... ..1. = Multiple results: Set
<             .... .... .... .1.. = PS Multiple results: Set
---
>             .... .... .... ..0. = Multiple results: Not set
>             .... .... .... .0.. = PS Multiple results: Not set
27,28c27,28
<             .... .... ...1 .... = Connect attrs: Set
<             .... .... ..1. .... = Plugin Auth LENENC Client Data: Set
---
>             .... .... ...0 .... = Connect attrs: Not set
>             .... .... ..0. .... = Plugin Auth LENENC Client Data: Not set
33c33
<         MAX Packet: 16777215
---
>         MAX Packet: 0
35c35,40
<         Unused: 0000000000000000000000000000000000000000000000
---
>         Unused: 00000000000000000000000000000000000000
>         MariaDB Extended Client Capabilities: 0x00000000
>             .... .... .... .... .... .... .... ...0 = Progress indication: Not set
>             .... .... .... .... .... .... .... ..0. = Multi commands: Not set
>             .... .... .... .... .... .... .... .0.. = Bulk Operations: Not set
>             .... .... .... .... .... .... .... 0... = Extended metadata: Not set
38,45c43,44
<         Client Auth Plugin: mysql_native_password
<         Connection Attributes
<             Connection Attributes length: 136
<             Connection Attribute - _runtime_version: 1.8.0_131
<             Connection Attribute - _client_version: 8.0.22
<             Connection Attribute - _client_license: GPL
<             Connection Attribute - _runtime_vendor: Oracle Corporation
<             Connection Attribute - _client_name: MySQL Connector/J
---
>         Client Auth Plugin: 
> 

from mysql-binlog-connector-java.

osheroff avatar osheroff commented on June 26, 2024

nice work @redcape. This totally matches what the spec for the handshake is; according to https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse we should always be sending the 'auth plugin name' in our scenario. I can't find any documentation that that field was added later than any conceivable mysql version we care about, so I think we're pretty safe to simply add it. Go ahead and PR the one liner and I'll get a release out.

I do wonder just what those azure-mysql db devs are up to, but hey.

from mysql-binlog-connector-java.

redcape avatar redcape commented on June 26, 2024

Hey @osheroff , thanks for merging and creating new version 0.23.4. Any ETA on when this will make it maven central or another public repo?

from mysql-binlog-connector-java.

osheroff avatar osheroff commented on June 26, 2024

0.23.4 released.

from mysql-binlog-connector-java.

redcape avatar redcape commented on June 26, 2024

Hi @osheroff can you point to where this is released, both maven central seems to have the latest version at 0.23.3

from mysql-binlog-connector-java.

osheroff avatar osheroff commented on June 26, 2024

harumph. the release seemed to go ok. trying again...

from mysql-binlog-connector-java.

osheroff avatar osheroff commented on June 26, 2024

ok this time it showed up at https://repo1.maven.org/maven2/com/zendesk/mysql-binlog-connector-java/0.23.4/ at least. so i think the artifact should be there...

from mysql-binlog-connector-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.