Add verification options to TLS config struct

This commit is contained in:
Pete Wildsmith 2017-04-25 23:29:43 +01:00 committed by GitHub
parent 3027335099
commit 56b122c501

View file

@ -28,6 +28,12 @@ type TLSConfig struct {
// KeyFile is used to provide a TLS key that is used for serving TLS connections.
// Must be provided to serve TLS connections.
KeyFile string `mapstructure:"key_file"`
// VerifyIncoming
VerifyIncoming bool `mapstructure:"verify_incoming"`
// VerifyOutgoing
VerifyOutgoing bool `mapstructure:"verify_outgoing"`
}
// Merge is used to merge two TLS configs together
@ -52,6 +58,12 @@ func (t *TLSConfig) Merge(b *TLSConfig) *TLSConfig {
if b.KeyFile != "" {
result.KeyFile = b.KeyFile
}
if b.VerifyIncoming {
result.VerifyIncoming = true
}
if b.VerifyOutgoing {
result.VerifyOutgoing = true
}
return &result
}