Certificate and key must both be specified or empty together

This commit is contained in:
Frederick F. Kautz IV 2015-01-29 11:29:42 -08:00
parent 58da5c0f87
commit 91384e73cf

View File

@ -40,6 +40,9 @@ func main() {
log.Println(address)
certFile := c.String("cert")
keyFile := c.String("key")
if (certFile != "" && keyFile == "") || (certFile == "" && keyFile != "") {
log.Fatal("Both certificate and key must be provided to enable https")
}
tls := (certFile != "" && keyFile != "")
storageType := getStorageType(storageTypeStr)
serverConfig := server.ServerConfig{