Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix connector + azure #272

Merged
merged 2 commits into from
Apr 20, 2019
Merged

fix connector + azure #272

merged 2 commits into from
Apr 20, 2019

Conversation

osheroff
Copy link
Collaborator

don't merge. just showing where I'm at.

@osheroff
Copy link
Collaborator Author

ok @shyiko I've got a connection to Azure working. This was a particularly tough one to solve, the code to respond to Azure's switch-auth message was simple enough, but if you look at my (admittedly hacked up) changes in PacketChannel, you'll see the artifact of a bizarre workaround; if we write just a single byte to azure (our length-of-packet byte), azure has troubles and immediately closes the connection. If, on the other hand, we buffer our write and write out the whole packet at once (basically ensuring the packet doesn't fragment), everything is fine.

I can make the code much cleaner but I thought I'd show you in code what I found.

@shyiko
Copy link
Owner

shyiko commented Apr 20, 2019

Great job, Ben! LGTM

Azure has a couple of differences from stock mysql.
First, it always sends a "switch auth" packet back from the first auth
request.  If you google "azure mysql handshake" you'll find a bunch of
other libraries that had to deal with this.

Second, it's rather persnickitty with the response to this; if we send
the response a byte or so at a time azure just closes our connection.
@osheroff osheroff changed the title WIP: try to figure out why azure is different authentication-wise fix connector + azure Apr 20, 2019
@osheroff
Copy link
Collaborator Author

ok @shyiko this is ready to merge now

@shyiko
Copy link
Owner

shyiko commented Apr 20, 2019

🥇

@shyiko shyiko merged commit 31fdde8 into shyiko:master Apr 20, 2019
@shyiko
Copy link
Owner

shyiko commented Apr 21, 2019

@osheroff 0.20.0 deployed to Maven Central

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants