README | 4 ++-- goircd.go | 7 +++---- diff --git a/README b/README index 93f7b2b5bbc0aebd80613d0c37f98e5b8c96207ec214f3095f2e5fca255359db..8344eef98542de4f5a80c538f0e9cec0215f247c52d9d3be3ed23e0d56c06eb6 100644 --- a/README +++ b/README @@ -56,8 +56,8 @@ omitted, then no logs will be kept * -statedir: directory where all channels states will be saved and loaded during startup. If omitted, then states will be lost after daemon termination -* -tlsbind/-tlskey/-tlscert: enable TLS, specify address to listen on, - certificate and key files +* -tlsbind/-pem: enable TLS, specify address to listen on and path + to PEM file with certificate and private key * -passwords: enable client authentication and specify path to passwords file * -verbose: increase log messages verbosity diff --git a/goircd.go b/goircd.go index 07f418d21f4538212f4cebcb132f7fdcc8f367ef8915da004e761f98d7e2c40d..1ecac78dad2194ac07ead1f245a241182f24a03fe67b6837215712337f991e54 100644 --- a/goircd.go +++ b/goircd.go @@ -41,8 +41,7 @@ statedir = flag.String("statedir", "", "Absolute path to directory for states") passwords = flag.String("passwords", "", "Optional path to passwords file") tlsBind = flag.String("tlsbind", "", "TLS address to bind to") - tlsKey = flag.String("tlskey", "", "TLS keyfile") - tlsCert = flag.String("tlscert", "", "TLS certificate") + tlsPEM = flag.String("tlspem", "", "Path to TLS certificat+key PEM file") verbose = flag.Bool("v", false, "Enable verbose logging.") ) @@ -138,9 +137,9 @@ log.Println("Raw listening on", *bind) go listenerLoop(listener, events) } if *tlsBind != "" { - cert, err := tls.LoadX509KeyPair(*tlsCert, *tlsKey) + cert, err := tls.LoadX509KeyPair(*tlsPEM, *tlsPEM) if err != nil { - log.Fatalf("Could not load TLS keys from %s and %s: %s", *tlsCert, *tlsKey, err) + log.Fatalf("Could not load TLS keys from %s: %s", *tlsPEM, err) } config := tls.Config{Certificates: []tls.Certificate{cert}} listenerTLS, err := tls.Listen("tcp", *tlsBind, &config)