fix(cmd): make tunasynctl work with both HTTP and HTTPS

This commit is contained in:
bigeagle 2016-12-11 02:13:19 +08:00
parent 7601e5793f
commit 97e9725774
No known key found for this signature in database
GPG Key ID: 9171A4571C27920A

View File

@ -99,8 +99,11 @@ func initialize(c *cli.Context) error {
}
// parse base url of the manager server
baseURL = fmt.Sprintf("https://%s:%d",
cfg.ManagerAddr, cfg.ManagerPort)
if cfg.CACert != "" {
baseURL = fmt.Sprintf("https://%s:%d", cfg.ManagerAddr, cfg.ManagerPort)
} else {
baseURL = fmt.Sprintf("http://%s:%d", cfg.ManagerAddr, cfg.ManagerPort)
}
logger.Infof("Use manager address: %s", baseURL)