diff --git a/client/connection.go b/client/connection.go index c1309ca..746a65a 100644 --- a/client/connection.go +++ b/client/connection.go @@ -114,18 +114,8 @@ func (conn *Conn) Connect(host string, pass ...string) os.Error { if !hasPort(host) { host += ":6697" } - // It's unfortunate that tls.Dial doesn't allow a tls.Config arg, - // so we simply replicate it here with the correct Config. - // http://codereview.appspot.com/2883041 - if s, err := net.Dial("tcp", host); err == nil { - // Passing nil config => certs are validated. - c := tls.Client(s, conn.SSLConfig) - if err = c.Handshake(); err == nil { - conn.sock = c - } else { - s.Close() - return err - } + if s, err := tls.Dial("tcp", host, conn.SSLConfig); err == nil { + conn.sock = s } else { return err }