mirror of
https://github.com/Luzifer/vault-openvpn.git
synced 2024-12-25 22:31:20 +00:00
fix errors not being returned
This commit is contained in:
parent
0cd0420a10
commit
6bfa753da7
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
@ -168,7 +168,7 @@ func revokeOlderCertificate(fqdn string) error {
|
||||||
path := strings.Join([]string{strings.Trim(cfg.PKIMountPoint, "/"), "cert", serial.(string)}, "/")
|
path := strings.Join([]string{strings.Trim(cfg.PKIMountPoint, "/"), "cert", serial.(string)}, "/")
|
||||||
cs, err := client.Logical().Read(path)
|
cs, err := client.Logical().Read(path)
|
||||||
if err != nil {
|
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))
|
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"}, "/")
|
path := strings.Join([]string{strings.Trim(cfg.PKIMountPoint, "/"), "cert", "ca"}, "/")
|
||||||
cs, err := client.Logical().Read(path)
|
cs, err := client.Logical().Read(path)
|
||||||
if err != nil {
|
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
|
return cs.Data["certificate"].(string), nil
|
||||||
|
|
Loading…
Reference in a new issue