-
Notifications
You must be signed in to change notification settings - Fork 28
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
*: support proxy-protocol #96
Conversation
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
logger.Error("require frontend capabilities", zap.Stringer("common", commonCaps), zap.Stringer("required", requiredCapabilities)) | ||
return errors.Wrapf(ErrCapabilityNegotiation, "require %s", requiredCapabilities&^commonCaps) | ||
} | ||
commonCaps := frontendCapability & proxyCapability |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use the capability in the second response from the client (if SSL is enabled). Some clients, such as sysbench, send 2 different capabilities. Only the last one is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be investigated, I rememered mysql-server sometimes will only use the first capabilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed, It is same in my several tests. The behavior should be determined by libmysql
linked to sysbench. Sysbench it self does not control this.
Signed-off-by: xhe <xw897002528@gmail.com>
HandshakeSecondTime also needs proxy protocol. This requires the authenticator to keep the real client address. You can do it in another PR. |
I agree. We have discussed too much on this PR. |
Signed-off-by: xhe <xw897002528@gmail.com>
Looks like some tests failed, let me handle it. |
Signed-off-by: xhe <xw897002528@gmail.com>
|
Signed-off-by: xhe xw897002528@gmail.com
What problem does this PR solve?
Issue Number: ref #14, proxy section
Problem Summary: As title, it is coded as minimal as possible. One thing, it is closed by default: because tidb can not automatically check if incoming connections are proxy or not. (start tidb using tiup with proxy-protocol will fail the health check). That said we can only enable it if the upstream server supports.
What is changed and how it works:
conf/namespace/example.yaml
,pkg/manager/router/router.go
,Makefile
,pkg/proxy/proxy.go
handshakeFirstTime
is rewritten such that handshakes between client and proxy is finished first. Another difference is that the new logic is more strict compare to the old logic, e.g. accurateSSLRequest
are sent instead ofhandshakeResp
.pkg/proxy/backend/util.go
a salt generatorToBytes()
, also avoid panic if callers passed different address family.pkg/proxy/net/packetio_test.go
weir
in github templateCheck List
Tests
Notable changes
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.