1
0
Fork 0
mirror of https://github.com/Luzifer/vault-openvpn.git synced 2024-11-08 16:20:05 +00:00

fix errors not being returned

This commit is contained in:
Knut Ahlers 2016-07-25 15:51:14 +02:00
parent 0cd0420a10
commit 6bfa753da7
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -168,7 +168,7 @@ func revokeOlderCertificate(fqdn string) error {
path := strings.Join([]string{strings.Trim(cfg.PKIMountPoint, "/"), "cert", serial.(string)}, "/")
cs, err := client.Logical().Read(path)
if err != nil {
errors.New("Unable to read certificate: " + err.Error())
return errors.New("Unable to read certificate: " + err.Error())
}
cn, err := commonNameFromCertificate(cs.Data["certificate"].(string))
@ -206,7 +206,7 @@ func getCACert() (string, error) {
path := strings.Join([]string{strings.Trim(cfg.PKIMountPoint, "/"), "cert", "ca"}, "/")
cs, err := client.Logical().Read(path)
if err != nil {
errors.New("Unable to read certificate: " + err.Error())
return errors.New("Unable to read certificate: " + err.Error())
}
return cs.Data["certificate"].(string), nil