Abort if dependent TLS flags are not passed.

Fixes #296

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2015-01-26 13:55:25 -08:00
parent fabe77bdde
commit 6cc7dacae2
1 changed files with 6 additions and 0 deletions

View File

@ -63,6 +63,12 @@ func manage(c *cli.Context) {
// If either --tls or --tlsverify are specified, load the certificates. // If either --tls or --tlsverify are specified, load the certificates.
if c.Bool("tls") || c.Bool("tlsverify") { if c.Bool("tls") || c.Bool("tlsverify") {
if !c.IsSet("tlscert") || !c.IsSet("tlskey") {
log.Fatalf("--tlscert and --tlskey must be provided when using --tls")
}
if c.Bool("tlsverify") && !c.IsSet("tlscacert") {
log.Fatalf("--tlscacert must be provided when using --tlsverify")
}
tlsConfig, err = loadTlsConfig( tlsConfig, err = loadTlsConfig(
c.String("tlscacert"), c.String("tlscacert"),
c.String("tlscert"), c.String("tlscert"),