util: store EnvVaultInsecure as string, not bool

The configuration option `EnvVaultInsecure` is expected to be a string,
not a boolean. By converting the bool back to a string (after
verification), it is now possible to skip the certificate validation
check by setting `vaultCAVerify: false` in the Vault configuration.

Fixes: #1852
Reported-by: Bryon Nevis <bryon.nevis@intel.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-02-02 10:49:30 +01:00 committed by mergify[bot]
parent df81022349
commit 582d004ca5

View File

@ -175,7 +175,7 @@ func (vc *vaultConnection) initConnection(kmsID string, config map[string]interf
if err != nil { if err != nil {
return fmt.Errorf("failed to parse 'vaultCAVerify': %w", err) return fmt.Errorf("failed to parse 'vaultCAVerify': %w", err)
} }
vaultConfig[api.EnvVaultInsecure] = !vaultCAVerify vaultConfig[api.EnvVaultInsecure] = strconv.FormatBool(!vaultCAVerify)
} }
vaultCAFromSecret := "" // optional vaultCAFromSecret := "" // optional