README: add SSLConfig to make connecting work

Without an SSLConfig, I get the following error:

```
E0225 08:43:12.384793   28687 connection.go:406] irc.recv(): tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config
```
This commit is contained in:
Michael Stapelberg 2016-02-25 08:50:53 +01:00
parent 8be75dd9d4
commit 51e6046a09
1 changed files with 2 additions and 0 deletions

View File

@ -19,6 +19,7 @@ Synopsis:
package main package main
import ( import (
"crypto/tls"
"fmt" "fmt"
irc "github.com/fluffle/goirc/client" irc "github.com/fluffle/goirc/client"
@ -31,6 +32,7 @@ Synopsis:
// Or, create a config and fiddle with it first: // Or, create a config and fiddle with it first:
cfg := irc.NewConfig("nick") cfg := irc.NewConfig("nick")
cfg.SSL = true cfg.SSL = true
cfg.SSLConfig = &tls.Config{ServerName: "irc.freenode.net"}
cfg.Server = "irc.freenode.net:7000" cfg.Server = "irc.freenode.net:7000"
cfg.NewNick = func(n string) string { return n + "^" } cfg.NewNick = func(n string) string { return n + "^" }
c = irc.Client(cfg) c = irc.Client(cfg)