mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
backport of commit 28e3b78e8e (#23759)
Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
108ab1b413
commit
24a15ddc08
@@ -82,6 +82,7 @@ type PluginAPIClientMeta struct {
|
||||
flagCAPath string
|
||||
flagClientCert string
|
||||
flagClientKey string
|
||||
flagServerName string
|
||||
flagInsecure bool
|
||||
}
|
||||
|
||||
@@ -93,6 +94,7 @@ func (f *PluginAPIClientMeta) FlagSet() *flag.FlagSet {
|
||||
fs.StringVar(&f.flagCAPath, "ca-path", "", "")
|
||||
fs.StringVar(&f.flagClientCert, "client-cert", "", "")
|
||||
fs.StringVar(&f.flagClientKey, "client-key", "", "")
|
||||
fs.StringVar(&f.flagServerName, "tls-server-name", "", "")
|
||||
fs.BoolVar(&f.flagInsecure, "tls-skip-verify", false, "")
|
||||
|
||||
return fs
|
||||
@@ -101,13 +103,13 @@ func (f *PluginAPIClientMeta) FlagSet() *flag.FlagSet {
|
||||
// GetTLSConfig will return a TLSConfig based off the values from the flags
|
||||
func (f *PluginAPIClientMeta) GetTLSConfig() *TLSConfig {
|
||||
// If we need custom TLS configuration, then set it
|
||||
if f.flagCACert != "" || f.flagCAPath != "" || f.flagClientCert != "" || f.flagClientKey != "" || f.flagInsecure {
|
||||
if f.flagCACert != "" || f.flagCAPath != "" || f.flagClientCert != "" || f.flagClientKey != "" || f.flagInsecure || f.flagServerName != "" {
|
||||
t := &TLSConfig{
|
||||
CACert: f.flagCACert,
|
||||
CAPath: f.flagCAPath,
|
||||
ClientCert: f.flagClientCert,
|
||||
ClientKey: f.flagClientKey,
|
||||
TLSServerName: "",
|
||||
TLSServerName: f.flagServerName,
|
||||
Insecure: f.flagInsecure,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user