diff --git a/irc/connection.go b/irc/connection.go index 4b05f57..e30160b 100644 --- a/irc/connection.go +++ b/irc/connection.go @@ -5,7 +5,6 @@ import ( "os" "net" "crypto/tls" - "crypto/rand" "fmt" "strings" "time" @@ -102,13 +101,16 @@ func (conn *Conn) Connect(host string, ssl bool, pass ...string) os.Error { } } - sock, err := net.Dial("tcp", "", host) + var sock net.Conn; + var err os.Error; + if ssl { + sock, err = tls.Dial("tcp", "", host) + } else { + 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