Fix SSL verification
This commit is contained in:
13
lysenko.go
13
lysenko.go
@@ -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)
|
||||||
|
Reference in New Issue
Block a user