From 04db2e2c8d95e923c0d0ba4d26a2c32e06376dd8 Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Wed, 3 Nov 2010 20:42:39 +0000 Subject: [PATCH] Revert "Use default root CAs for SSL connections, h/t raylu." This reverts commit 7515f11470d72883f5852961c13618dc84b7ae47. This doesn't use the "default" CAs, it explicitly turns off CA verification. Probably not the best of ideas. Patch to enable optional verification coming. Conflicts: irc/connection.go --- irc/connection.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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