vault write iptv_qa_pki/issue/test-dot-local common_name=localhost alt_names="vault.test.local,*.vault.test.local" ip_sans="127.0.0.1,192.168.1.77" > /tmp/localhost.certs
When i try to do the same with golang api, i get nil output
package main
import (
vaultapi "github.com/hashicorp/vault/api"
"log"
)
func main() {
client, err := vaultapi.NewClient(vaultapi.DefaultConfig())
if err == nil {
log.Println(err)
return
}
token := "28ef4e40-2597-4571-aadf-41300df98338"
client.SetToken(token)
c := client.Logical()
sec, err := c.Write("iptv_qa_pki/issue/test-dot-local",
map[string]interface{}{
"common_name": "localhost",
"alt_names": "*.test.local",
"ip_sans": "127.0.0.1",
})
if err == nil {
log.Println(err)
return
}
log.Println(sec)
}
When I do - go run program.go . My output is
2016/05/31 15:18:22 <nil>
What am I doing wrong here?
I realize this is a vault forum and not golang one, so I apologize for taking the liberty to ask golang vault related issue.
But any help/pointer would be appreciated.
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/vault/issues
IRC: #vault-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Vault" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vault-tool+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/454b8af9-f856-49e5-8ab4-53c841b08761%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi mg,
The `if err == nil` lines should be `if err != nil`
Hope that helps
Matt