add config ssl file check

This commit is contained in:
root committed 2019-06-30 10:12:00 +00:00
1 parent c1f0ae6b9b
commit 45c8fc4f0e
2 files changed
+22 -2

No files matched your search

+12
View File
@@ -76,5 +76,17 @@ func LoadConfig(p ...string) (err error) {
return err
}
if exists := utils.CheckExists(conf.Database.SSLCa, false); !exists {
return errors.New("ssl ca file not exists")
}
if exists := utils.CheckExists(conf.Database.SSLCrt, false); !exists {
return errors.New("ssl crt file not exists")
}
if exists := utils.CheckExists(conf.Database.SSLKey, false); !exists {
return errors.New("ssl key file not exists")
}
return
}