Skip to content

Commit afeb2ef

Browse files
committed
Fix useTLS assignment
useTLS was set to true in the case that no certFile or keyFile was set.
1 parent 6eaa4d2 commit afeb2ef

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llama-swap.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,13 @@ func main() {
5858
}
5959

6060
// Validate TLS flags.
61-
var useTLS bool
61+
var useTLS = (*certFile != "" && *keyFile != "")
6262
if (*certFile != "" && *keyFile == "") ||
6363
(*certFile == "" && *keyFile != "") {
6464
fmt.Println("Error: Both --tls-cert-file and --tls-key-file must be provided for TLS.")
6565
os.Exit(1)
66-
} else {
67-
useTLS = true
6866
}
67+
6968
// Set default ports.
7069
if *listenStr == "" {
7170
defaultPort := ":8080"

0 commit comments

Comments
 (0)