From 570662cdcc4019763a5d224c4086c29bf9074bc7 Mon Sep 17 00:00:00 2001 From: "." <.@.> Date: Mon, 2 May 2016 18:45:51 +1200 Subject: [PATCH] remove TLS support (should be provided by a reverse proxy) --HG-- branch : nmdc-ircfrontend --- main.go | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/main.go b/main.go index 81f1934..0f7e142 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,6 @@ package main import ( - "crypto/tls" "flag" "log" "os" @@ -9,8 +8,6 @@ import ( ) var ( - tlsKeyFile = flag.String("tls-key", "tls.key", "The private key file used for TLS") - tlsCertFile = flag.String("tls-cert", "tls.crt", "The certificate file used for TLS") ircAddress = flag.String("irc-address", ":6697", "The address:port to bind to and listen for clients on") serverName = flag.String("irc-servername", "rosella", "Server name displayed to clients") authFile = flag.String("irc-authfile", "", "File containing usernames and passwords of operators.") @@ -71,34 +68,8 @@ func main() { server.motd = string(data[:size]) } - tlsConfig := new(tls.Config) - - tlsConfig.PreferServerCipherSuites = true - tlsConfig.CipherSuites = []uint16{ - tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, - tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, - tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, - tls.TLS_RSA_WITH_AES_256_CBC_SHA, - tls.TLS_RSA_WITH_AES_128_CBC_SHA, - tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA} - - cert, err := tls.LoadX509KeyPair(*tlsCertFile, *tlsKeyFile) + listener, err := net.Listen("tcp", *ircAddress) if err != nil { - log.Printf("Error loading tls certificate and key files.") - log.Printf(err.Error()) - return - } - - log.Printf("Loaded certificate and key successfully.") - - tlsConfig.Certificates = []tls.Certificate{cert} - - //Fills out tlsConfig.NameToCertificate - tlsConfig.BuildNameToCertificate() - - tlsListener, err := tls.Listen("tcp", *ircAddress, tlsConfig) - if err != nil { - log.Printf("Could not open tls listener.") log.Printf(err.Error()) return } @@ -108,7 +79,7 @@ func main() { log.Printf("Listening on %s", *ircAddress) for { - conn, err := tlsListener.Accept() + conn, err := listener.Accept() if err != nil { log.Printf("Error accepting connection.") log.Printf(err.Error())