diff --git a/irc/connection.go b/irc/connection.go index 240b59e..663e5b0 100644 --- a/irc/connection.go +++ b/irc/connection.go @@ -5,6 +5,7 @@ import ( "os" "net" "crypto/tls" + "crypto/rand" "fmt" "strings" "time" @@ -100,16 +101,13 @@ func (conn *Conn) Connect(host string, ssl bool, pass string) os.Error { } } - var sock net.Conn; - var err os.Error; - if ssl { - sock, err = tls.Dial("tcp", "", host) - } else { - sock, err = net.Dial("tcp", "", host) - } + sock, err := net.Dial("tcp", "", host) if err != nil { return err } + if ssl { + sock = tls.Client(sock, &tls.Config{Rand: rand.Reader, Time: time.Nanoseconds}) + } conn.Host = host conn.SSL = ssl @@ -121,7 +119,6 @@ func (conn *Conn) Connect(host string, ssl bool, pass string) os.Error { go conn.send() go conn.recv() - // see getStringMsg() in commands.go for what this does if pass != "" { conn.Pass(pass) } diff --git a/rbot.conf.example b/rbot.conf.example index ce22100..bff4216 100644 --- a/rbot.conf.example +++ b/rbot.conf.example @@ -2,7 +2,7 @@ server: irc.rizon.net nick: rbot user: rbot -ssl: false +ssl: true trigger: ! [#raylu]