-
Notifications
You must be signed in to change notification settings - Fork 131
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 TLS for components #904
Conversation
pump/server.go
Outdated
@@ -968,14 +966,21 @@ func (s *Server) waitUntilCommitTSSaved(ctx context.Context, ts int64, checkInte | |||
} | |||
} | |||
|
|||
func listen(network, addr string) (net.Listener, error) { | |||
func listen(network, addr string, tlsConfig *tls.Config) (listener net.Listener, err error) { |
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.
It seems we may need to update similar code in both pump
and drainer
, maybe it's time to extract this to the util
package?
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.
extract by 4762c05
rest LGTM |
@GregoryIan PTAL |
/run-all-tests @GregoryIan PTAL |
/run-all-tests |
/run-all-tests |
/run-all-tests |
/run-all-tests |
/run-all-tests |
switch cfg.Command { | ||
case ctl.GenerateMeta: | ||
err = ctl.GenerateMetaInfo(cfg) | ||
case ctl.QueryPumps: | ||
err = ctl.QueryNodesByKind(cfg.EtcdURLs, node.PumpNode, cfg.ShowOfflineNodes) | ||
err = ctl.QueryNodesByKind(cfg.EtcdURLs, node.PumpNode, cfg.ShowOfflineNodes, cfg.TLS) |
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.
I think we should initial all clients (like registry
, dial Client
) together, the reason is to ensure that TLS
are processed correctly and uniformly, here implementation is a weird example:
- we provide
TLS
config in interface ofgithub.com/pingcap/tidb-binlog/binlogctl
, likeQueryNodesByKind
- we do
binlogctl.InitHTTPSClient
separately
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.
@@ -72,6 +72,8 @@ func (c *Config) ToTiDBSecurityConfig() config.Security { | |||
ClusterSSLKey: c.SSLKey, | |||
} | |||
|
|||
// The TiKV client(kvstore.New) we use will use this global var as the TLS config. | |||
// TODO avoid such magic implicit change when call this func. |
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.
TODO 👍
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.
LGTM
tests/run.sh
Outdated
sleep 1 | ||
done | ||
|
||
|
||
# on CI curl's version is too old: curl: (58) unable to load client key: -8178 (SEC_ERROR_BAD_KEY))) |
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.
can we remove it now?
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.
removed dfe4e41
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.
LGTM
/run-all-tests |
cherry pick to release-3.0 failed |
truely support TLS for components. before this pr if enable TLS for components - `tidb` will fail to connect to `pump` - no TLS between drainer and pump - no enable TLS for tikv client in `drainer` - `binlogctl` can't work actually ... [relate docs](https://pingcap.com/docs/stable/how-to/secure/enable-tls-between-components/) ([Chinese version](https://pingcap.com/docs-cn/stable/how-to/secure/enable-tls-between-components/)) This Commit: - properly handle things about TLS when enabling TLS - enable TLS in the integration tests - log pump config at startup time
* support TLS for components (#904) [relate docs](https://pingcap.com/docs/stable/how-to/secure/enable-tls-between-components/) ([Chinese version](https://pingcap.com/docs-cn/stable/how-to/secure/enable-tls-between-components/)) This Commit: - properly handle things about TLS when enabling TLS - enable TLS in the integration tests - log pump config at startup time
What problem does this PR solve?
truely support TLS for components.
before this pr if enable TLS for components
tidb
will fail to connect topump
drainer
binlogctl
can't work actually...
relate docs (Chinese version)
What is changed and how it works?
Check List
Tests
enable TLS for all components and check replication works, include tidb/tikv/pd/pump/drainer/binlogctl
Code changes
Side effects
Related changes
tidb-ansible
repository ???having not tried using ansible to deploy.