Skip to content

Commit

Permalink
Error on incomplete tls configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Petrausch committed Jul 8, 2020
1 parent fa31197 commit 62d3a52
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ func validateTLSFiles(argCafile, argKey, argCert string) error {
}
}

if len(argKey) > 0 && len(argCert) < 1 {
return fmt.Errorf("A key file is specified but no certificate file")
}

if len(argKey) < 1 && len(argCert) > 0 {
return fmt.Errorf("A cert file is specified but no key file")
}
return nil
}

Expand Down

0 comments on commit 62d3a52

Please sign in to comment.