Fix SSL verification

This commit is contained in:
2016-10-15 00:20:34 +01:00
parent 8a5cfde134
commit cad4334063

View File

@@ -2,9 +2,11 @@ package main
import ( import (
"context" "context"
"crypto/tls"
"flag" "flag"
"log" "log"
"math/rand" "math/rand"
"net"
"strings" "strings"
"time" "time"
@@ -39,6 +41,17 @@ func main() {
config.Server = *host config.Server = *host
config.Pass = *nickserv config.Pass = *nickserv
config.SSL = *ssl config.SSL = *ssl
if config.SSL {
hostname, _, err := net.SplitHostPort(config.Server)
if err != nil {
log.Fatal(err)
}
config.SSLConfig = &tls.Config{
ServerName: hostname,
}
}
adapter := irc.New(config, channelList...) adapter := irc.New(config, channelList...)
db, err := quotedb.New(*quotes) db, err := quotedb.New(*quotes)