Skip to content

Commit

Permalink
Fix panic in etcd validate secure endpoints etcd-io#13810
Browse files Browse the repository at this point in the history
`ValidateSecureEndpoints()` should call `t.DialContext()` instead of `t.Dial()`, because `t.Dial` is `nil`
  • Loading branch information
eval-exec committed Mar 22, 2022
1 parent 5fe4d55 commit 7f5f0aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/pkg/transport/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package transport

import (
"context"
"fmt"
"strings"
"time"
Expand All @@ -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
Expand Down

0 comments on commit 7f5f0aa

Please sign in to comment.