From dec20c2cd0b04a1d91ae7b479b6086f282bd168b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Busse?= Date: Thu, 8 Mar 2018 17:37:26 +0000 Subject: [PATCH] Add a tlsonly option --- goircd.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/goircd.go b/goircd.go index d827d0c..a48b33e 100644 --- a/goircd.go +++ b/goircd.go @@ -49,6 +49,7 @@ var ( passwords = flag.String("passwords", "", "Optional path to passwords file") tlsBind = flag.String("tlsbind", "", "TLS address to bind to") tlsPEM = flag.String("tlspem", "", "Path to TLS certificat+key PEM file") + tlsonly = flag.Bool("tlsonly", false, "Disable listening on non tls-port") proxyTimeout = flag.Uint("proxytimeout", PROXY_TIMEOUT, "Timeout when using proxy protocol") metrics = flag.Bool("metrics", false, "Enable metrics export") verbose = flag.Bool("v", false, "Enable verbose logging.") @@ -150,7 +151,7 @@ func Run() { proxyTimeout := time.Duration(uint(*proxyTimeout)) * time.Second - if *bind != "" { + if *bind != "" && !*tlsonly { listener, err := net.Listen("tcp", *bind) if err != nil { log.Fatalf("Can not listen on %s: %v", *bind, err)