dispatch/server/tls.go

26 lines
347 B
Go
Raw Normal View History

2016-01-04 18:26:32 +00:00
package server
import (
"os"
2016-03-01 00:51:26 +00:00
"github.com/spf13/viper"
2016-01-04 18:26:32 +00:00
)
func certExists() bool {
cert := viper.GetString("https.cert")
key := viper.GetString("https.key")
if cert == "" || key == "" {
return false
}
if _, err := os.Stat(cert); err != nil {
return false
}
if _, err := os.Stat(key); err != nil {
return false
}
return true
}