Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

.*: support TLS #569

Merged
merged 56 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
72ba1e8
add security config
WangXiangUSTC Mar 15, 2020
87d8a77
update mod
WangXiangUSTC Mar 15, 2020
14cb434
support tls in worker
WangXiangUSTC Mar 15, 2020
b32e4ac
update tools
WangXiangUSTC Mar 16, 2020
c1f1a9f
master support tls
WangXiangUSTC Mar 16, 2020
054ab17
dmctl support tls
WangXiangUSTC Mar 16, 2020
e681c98
add todo
WangXiangUSTC Mar 16, 2020
cd271fd
support tls for connection to database
WangXiangUSTC Mar 17, 2020
de430c3
minor update for database tls
WangXiangUSTC Mar 19, 2020
e8bed44
update tls test
WangXiangUSTC Mar 19, 2020
5cecdfc
use https
WangXiangUSTC Mar 22, 2020
218ee3f
refine code and add check scripts
WangXiangUSTC Mar 22, 2020
ba490ec
remove useless code
WangXiangUSTC Mar 22, 2020
f565236
minor update
WangXiangUSTC Mar 22, 2020
b89233c
minor fix
WangXiangUSTC Mar 22, 2020
b25e3f3
print tidb log
WangXiangUSTC Mar 23, 2020
2b9532f
update tidb config
WangXiangUSTC Mar 23, 2020
629ab7a
minor fix and update ut for config adjust
WangXiangUSTC Mar 23, 2020
d5054f9
update tidb-tools
WangXiangUSTC Mar 23, 2020
c69430a
merge master and resolve conflicts
WangXiangUSTC May 6, 2020
0d3d442
minor fix
WangXiangUSTC May 7, 2020
7bb9152
minor update
WangXiangUSTC May 7, 2020
2095335
Merge branch 'master' into xiang/tls
WangXiangUSTC May 7, 2020
05df068
Merge branch 'master' into xiang/tls
WangXiangUSTC May 8, 2020
3e3e7c1
merge master and resolve conflicts
WangXiangUSTC Jul 14, 2020
c56bc5c
Merge branch 'xiang/tls' of https://github.com/pingcap/dm into xiang/tls
WangXiangUSTC Jul 14, 2020
4c8c3d2
update task fiel
WangXiangUSTC Jul 14, 2020
7ef2b5a
minor fix
WangXiangUSTC Jul 14, 2020
ffc54ea
fix use http api
WangXiangUSTC Jul 15, 2020
77a9e95
add http api test
WangXiangUSTC Jul 15, 2020
0f36bb0
minor fix && address comment
WangXiangUSTC Jul 16, 2020
56aa0aa
update error
WangXiangUSTC Jul 16, 2020
628e719
fix test
WangXiangUSTC Jul 16, 2020
0f97c30
Apply suggestions from code review
WangXiangUSTC Jul 16, 2020
3cea158
use terror
WangXiangUSTC Jul 16, 2020
db51e01
Merge branch 'xiang/tls' of https://github.com/pingcap/dm into xiang/tls
WangXiangUSTC Jul 16, 2020
210f306
update terror
WangXiangUSTC Jul 16, 2020
23e1a5e
print log
WangXiangUSTC Jul 16, 2020
86ef642
merge mnaster
WangXiangUSTC Jul 16, 2020
fbd42d0
comment script
WangXiangUSTC Jul 16, 2020
23d020f
minor fix on test
WangXiangUSTC Jul 17, 2020
e862c9f
merge master
WangXiangUSTC Jul 17, 2020
bc5315f
merge master
WangXiangUSTC Jul 18, 2020
3627475
Merge branch 'master' into xiang/tls
GMHDBJD Jul 20, 2020
30f5fa1
Merge branch 'master' into xiang/tls
GMHDBJD Jul 20, 2020
5cf5d6c
address comemnt
WangXiangUSTC Jul 22, 2020
4ed6db9
add flag for tls
WangXiangUSTC Jul 22, 2020
3e656ee
update String for strArray
WangXiangUSTC Jul 22, 2020
d8a0fe0
remove useless config for embed etcd, and can works for allowd cn
WangXiangUSTC Jul 22, 2020
126769b
revert unexpect update && update test
WangXiangUSTC Jul 22, 2020
809fe07
remove https prefix check
WangXiangUSTC Jul 22, 2020
3a18348
update RegisterTLSConfig for mysql
WangXiangUSTC Jul 22, 2020
d4cf9d2
add func do in db's close
WangXiangUSTC Jul 23, 2020
66b8e9d
revert change
WangXiangUSTC Jul 23, 2020
677c679
Merge branch 'master' into xiang/tls
csuzhangxc Jul 23, 2020
32f0b57
address comment
WangXiangUSTC Jul 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion dm/config/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,17 @@ type Security struct {
SSLCA string `toml:"ssl-ca" json:"ssl-ca" yaml:"ssl-ca"`
SSLCert string `toml:"ssl-cert" json:"ssl-cert" yaml:"ssl-cert"`
SSLKey string `toml:"ssl-key" json:"ssl-key" yaml:"ssl-key"`
CertAllowedCN []string `toml:"cert-allowed-cn" json:"cert-allowed-cn" yaml:"cert-allowed-cn"`
CertAllowedCN strArray `toml:"cert-allowed-cn" json:"cert-allowed-cn" yaml:"cert-allowed-cn"`
}

// used for parse string slice in flag
type strArray []string

func (i *strArray) String() string {
return "string array"
csuzhangxc marked this conversation as resolved.
Show resolved Hide resolved
}

func (i *strArray) Set(value string) error {
*i = append(*i, value)
return nil
}
5 changes: 5 additions & 0 deletions dm/master/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ func NewConfig() *Config {
fs.StringVar(&cfg.AdvertisePeerUrls, "advertise-peer-urls", "", `advertise URLs for peer traffic (default "${peer-urls}")`)
fs.StringVar(&cfg.Join, "join", "", `join to an existing cluster (usage: cluster's "${master-addr}" list, e.g. "127.0.0.1:8261,127.0.0.1:18261"`)

fs.StringVar(&cfg.SSLCA, "ssl-ca", "", "path of file that contains list of trusted SSL CAs for connection")
fs.StringVar(&cfg.SSLCert, "ssl-cert", "", "path of file that contains X509 certificate in PEM format for connection")
fs.StringVar(&cfg.SSLKey, "ssl-key", "", "path of file that contains X509 key in PEM format for connection")
fs.Var(&cfg.CertAllowedCN, "cert-allowed-cn", "the trusted common name that allowed to visit")

return cfg
}

Expand Down
6 changes: 6 additions & 0 deletions dm/worker/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ func NewConfig() *Config {
fs.StringVar(&cfg.Join, "join", "", `join to an existing cluster (usage: dm-master cluster's "${master-addr}")`)
fs.StringVar(&cfg.Name, "name", "", "human-readable name for DM-worker member")
fs.Int64Var(&cfg.KeepAliveTTL, "keepalive-ttl", defaultKeepAliveTTL, "dm-worker's TTL for keepalive with etcd (in seconds)")

fs.StringVar(&cfg.SSLCA, "ssl-ca", "", "path of file that contains list of trusted SSL CAs for connection")
fs.StringVar(&cfg.SSLCert, "ssl-cert", "", "path of file that contains X509 certificate in PEM format for connection")
fs.StringVar(&cfg.SSLKey, "ssl-key", "", "path of file that contains X509 key in PEM format for connection")
fs.Var(&cfg.CertAllowedCN, "cert-allowed-cn", "the trusted common name that allowed to visit")

return cfg
}

Expand Down