From 91384e73cf4e10bcf7fc00f1e5d55a059db2a39e Mon Sep 17 00:00:00 2001 From: "Frederick F. Kautz IV" Date: Thu, 29 Jan 2015 11:29:42 -0800 Subject: [PATCH] Certificate and key must both be specified or empty together --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index feaba0eef..108b2697e 100644 --- a/main.go +++ b/main.go @@ -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{