]> Cypherpunks.ru repositories - goircd.git/blobdiff - goircd.go
Combine TLS cert and key options in single one
[goircd.git] / goircd.go
index a0633ad9065aa1a3f310734d07ae7693f458488b..b0f5e07716db40625c08378d046670c9154c68d8 100644 (file)
--- a/goircd.go
+++ b/goircd.go
@@ -41,8 +41,7 @@ var (
        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 @@ func Run() {
                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)