Fix panic in etcd validate secure endpoints #13810

`ValidateSecureEndpoints()` should call `t.DialContext()` instead of `t.Dial()`, because `t.Dial` is `nil`
dependabot/go_modules/go.uber.org/atomic-1.10.0
EXEC 2022-03-19 17:48:30 +08:00 committed by eval-exec
parent 3254125e6c
commit bd7d09255b
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@
package transport
import (
"context"
"fmt"
"strings"
"time"
@ -34,7 +35,7 @@ func ValidateSecureEndpoints(tlsInfo TLSInfo, eps []string) ([]string, error) {
errs = append(errs, fmt.Sprintf("%q is insecure", ep))
continue
}
conn, cerr := t.Dial("tcp", ep[len("https://"):])
conn, cerr := t.DialContext(context.Background(), "tcp", ep[len("https://"):])
if cerr != nil {
errs = append(errs, fmt.Sprintf("%q failed to dial (%v)", ep, cerr))
continue