Skip to content

Commit

Permalink
test -key-file and -certificate-key inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanholsteijn committed Nov 26, 2021
1 parent 66ab6b1 commit 68b3447
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,21 @@ func main() {

if certificateFile != "" && keyFile == "" || keyFile != "" && certificateFile == "" {
log.Fatalf("both -certificate-file and -certificate-key are required.")
} else if keyFile != "" {
if s, err := os.Stat(keyFile); err != nil {
log.Fatalf("invalid option -key-file, %s", err)
} else {
if s.IsDir() {
log.Fatalf("option -key-file must be a file")
}
}
if s, err := os.Stat(certificateFile); err != nil {
log.Fatalf("invalid option -certificate-file, %s", err)
} else {
if s.IsDir() {
log.Fatalf("option -certificate-file must be a file")
}
}
}

if audience == "" {
Expand Down

0 comments on commit 68b3447

Please sign in to comment.