mirror of
https://github.com/fluffle/goirc
synced 2025-05-13 02:53:19 +00:00
Use default root CAs for SSL connections
This commit is contained in:
parent
bfe0705337
commit
41826d3b24
2 changed files with 6 additions and 9 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue