Skip to content

Commit

Permalink
util: Adjust the minimum TLS version supported by TiDB tools from 1.0…
Browse files Browse the repository at this point in the history
… to 1.2 (pingcap#33997)

close pingcap#33996
  • Loading branch information
Zengxian Ding authored Apr 15, 2022
1 parent 4844c83 commit 88c18ea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions br/pkg/mock/mock_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func waitUntilServerOnline(addr string, statusPort uint) string {
// connect http status
statusURL := fmt.Sprintf("http://127.0.0.1:%d/status", statusPort)
for retry = 0; retry < retryTime; retry++ {
// #nosec G107
resp, err := http.Get(statusURL) // nolint:noctx,gosec
if err == nil {
// Ignore errors.
Expand Down
2 changes: 1 addition & 1 deletion cmd/pluginpkg/pluginpkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func main() {
}

genFileName := filepath.Join(pkgDir, filepath.Base(pkgDir)+".gen.go")
genFile, err := os.OpenFile(genFileName, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0700) // # nosec G302
genFile, err := os.OpenFile(genFileName, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0700) // #nosec G302
if err != nil {
log.Printf("generate code failure during prepare output file, %+v\n", err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion executor/select_into.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (s *SelectIntoExec) Open(ctx context.Context) error {
}

// MySQL-compatible behavior: allow files to be group-readable
f, err := os.OpenFile(s.intoOpt.FileName, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0640) // # nosec G302
f, err := os.OpenFile(s.intoOpt.FileName, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0640) // #nosec G302
if err != nil {
return errors.Trace(err)
}
Expand Down
8 changes: 4 additions & 4 deletions util/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ func ToTLSConfigWithVerify(caPath, certPath, keyPath string, verifyCN []string)
if !certPool.AppendCertsFromPEM(ca) {
return nil, errors.New("failed to append ca certs")
}
//nolint:gosec

tlsCfg := &tls.Config{
MinVersion: tls.VersionTLS10,
MinVersion: tls.VersionTLS12,
Certificates: certificates,
RootCAs: certPool,
ClientCAs: certPool,
Expand Down Expand Up @@ -123,9 +123,9 @@ func ToTLSConfigWithVerifyByRawbytes(caData, certData, keyData []byte, verifyCN
if !certPool.AppendCertsFromPEM(caData) {
return nil, errors.New("failed to append ca certs")
}
//nolint:gosec

tlsCfg := &tls.Config{
MinVersion: tls.VersionTLS10,
MinVersion: tls.VersionTLS12,
Certificates: certificates,
RootCAs: certPool,
ClientCAs: certPool,
Expand Down

0 comments on commit 88c18ea

Please sign in to comment.