Revert "Use default root CAs for SSL connections, h/t raylu."

This reverts commit 7515f11470.

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
This commit is contained in:
Alex Bramley 2010-11-03 20:42:39 +00:00
parent 34b3299d41
commit 04db2e2c8d
1 changed files with 7 additions and 5 deletions

View File

@ -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