author | Alberto Bertogli
<albertito@blitiri.com.ar> 2016-11-22 20:39:19 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2016-11-22 20:39:19 UTC |
parent | 170aaaf490e47341a0bae7e8cb39fbb38fde5247 |
chasquid.go | +8 | -2 |
diff --git a/chasquid.go b/chasquid.go index 2b009d4..80fb3af 100644 --- a/chasquid.go +++ b/chasquid.go @@ -94,13 +94,19 @@ func main() { log.Infof("Loading certificates") for _, info := range mustReadDir("certs/") { name := info.Name() + dir := filepath.Join("certs/", name) + if fi, err := os.Stat(dir); err == nil && !fi.IsDir() { + // Skip non-directories. + continue + } + log.Infof(" %s", name) - certPath := filepath.Join("certs/", name, "fullchain.pem") + certPath := filepath.Join(dir, "fullchain.pem") if _, err := os.Stat(certPath); os.IsNotExist(err) { continue } - keyPath := filepath.Join("certs/", name, "privkey.pem") + keyPath := filepath.Join(dir, "privkey.pem") if _, err := os.Stat(keyPath); os.IsNotExist(err) { continue }