Skip to content

Commit

Permalink
Merge pull request #7659 from gyuho/aaa
Browse files Browse the repository at this point in the history
pkg/transport: remove port in Certificate.IPAddresses
  • Loading branch information
gyuho authored Apr 5, 2017
2 parents c7bdd7e + 8a7a548 commit 43f795a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/transport/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"net"
"os"
"path/filepath"
"strings"
"time"

"github.com/coreos/etcd/pkg/tlsutil"
Expand Down Expand Up @@ -118,10 +117,11 @@ func SelfCert(dirpath string, hosts []string) (info TLSInfo, err error) {
}

for _, host := range hosts {
if ip := net.ParseIP(host); ip != nil {
h, _, _ := net.SplitHostPort(host)
if ip := net.ParseIP(h); ip != nil {
tmpl.IPAddresses = append(tmpl.IPAddresses, ip)
} else {
tmpl.DNSNames = append(tmpl.DNSNames, strings.Split(host, ":")[0])
tmpl.DNSNames = append(tmpl.DNSNames, h)
}
}

Expand Down

0 comments on commit 43f795a

Please sign in to comment.