Skip to content

Commit

Permalink
sett ServerName on tls.Config even when InsecureSkipVeriy is true (#860)
Browse files Browse the repository at this point in the history
This behavior also matches the old dialer behavior.
  • Loading branch information
rhansen2 authored Mar 7, 2022
1 parent 34e8f71 commit a9325a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ func (g *connGroup) connect(ctx context.Context, addr net.Addr) (*conn, error) {
}()

if tlsConfig := g.pool.tls; tlsConfig != nil {
if tlsConfig.ServerName == "" && !tlsConfig.InsecureSkipVerify {
if tlsConfig.ServerName == "" {
host, _ := splitHostPort(netAddr.String())
tlsConfig = tlsConfig.Clone()
tlsConfig.ServerName = host
Expand Down

0 comments on commit a9325a2

Please sign in to comment.