Skip to content

Commit

Permalink
Fix: leader_tls_servername raft option only worked when used with mTL…
Browse files Browse the repository at this point in the history
…S and/or an explicit CA cert. (#11252) (#11282)
  • Loading branch information
ncabatoff authored Apr 6, 2021
1 parent 94d8339 commit d889673
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vault/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,12 @@ func (c *Core) JoinRaftCluster(ctx context.Context, leaderInfos []*raft.LeaderJo
}
leaderInfo.TLSConfig.ServerName = leaderInfo.LeaderTLSServerName
}
if leaderInfo.TLSConfig == nil && leaderInfo.LeaderTLSServerName != "" {
leaderInfo.TLSConfig, err = tlsutil.SetupTLSConfig(map[string]string{"address": leaderInfo.LeaderTLSServerName}, "")
if err != nil {
return errwrap.Wrapf("failed to create TLS config: {{err}}", err)
}
}

if leaderInfo.TLSConfig != nil {
transport.TLSClientConfig = leaderInfo.TLSConfig.Clone()
Expand Down

0 comments on commit d889673

Please sign in to comment.