getCertsPath should use getConfigPath instead of defaulting to users homedir. (#2039)

Fixes #2028
This commit is contained in:
Danilo Pereira 2016-06-30 19:49:18 -03:00 committed by Harshavardhana
parent 57bc08cc7e
commit 812554087f
2 changed files with 4 additions and 5 deletions

View file

@ -19,8 +19,6 @@ package main
import (
"os"
"path/filepath"
"github.com/minio/go-homedir"
)
// createCertsPath create certs path.
@ -34,11 +32,12 @@ func createCertsPath() error {
// getCertsPath get certs path.
func getCertsPath() (string, error) {
homeDir, err := homedir.Dir()
var certsPath string
configDir, err := getConfigPath()
if err != nil {
return "", err
}
certsPath := filepath.Join(homeDir, globalMinioCertsDir)
certsPath = filepath.Join(configDir, globalMinioCertsDir)
return certsPath, nil
}

View file

@ -27,7 +27,7 @@ const (
const (
globalMinioConfigVersion = "4"
globalMinioConfigDir = ".minio"
globalMinioCertsDir = ".minio/certs"
globalMinioCertsDir = "certs"
globalMinioCertFile = "public.crt"
globalMinioKeyFile = "private.key"
globalMinioConfigFile = "config.json"