add config ssl file check

This commit is contained in:
Jay
2019-06-30 10:12:00 +00:00
parent c1f0ae6b9b
commit 45c8fc4f0e
2 changed files with 22 additions and 2 deletions
+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
}