Skip to content

Commit

Permalink
vault: fix ca_chain conversion
Browse files Browse the repository at this point in the history
Vault API returns []interface{}, not []string.
  • Loading branch information
johanbrandhorst committed Sep 26, 2018
1 parent bf029fb commit cb586d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ func (v *VaultIssuer) Issue(ctx context.Context, commonName string, conf *CertCo

caChainPEM := certPEM
if caChain, ok := secret.Data["ca_chain"]; ok {
for _, pemData := range caChain.([]string) {
caChainPEM = caChainPEM + "\n" + pemData
for _, pemData := range caChain.([]interface{}) {
caChainPEM = caChainPEM + "\n" + pemData.(string)
}
} else if ca, ok := secret.Data["issuing_ca"]; ok {
caChainPEM = caChainPEM + "\n" + ca.(string)
Expand Down

0 comments on commit cb586d7

Please sign in to comment.