libnmdc: add SkipVerifyTLS option

This commit is contained in:
mappu 2016-04-03 13:17:29 +12:00
parent ec0a781538
commit da92afa51e
1 changed files with 4 additions and 1 deletions

View File

@ -77,6 +77,7 @@ func init() {
type HubConnectionOptions struct { type HubConnectionOptions struct {
Address HubAddress Address HubAddress
SkipVerifyTLS bool // using a negative verb, because bools default to false
Self UserInfo Self UserInfo
NickPassword string NickPassword string
NumEventsToBuffer uint NumEventsToBuffer uint
@ -344,7 +345,9 @@ func (this *HubConnection) worker() {
if this.conn == nil { if this.conn == nil {
if this.Hco.Address.IsSecure() { if this.Hco.Address.IsSecure() {
this.conn, err = tls.Dial("tcp", this.Hco.Address.GetHostOnly(), nil) this.conn, err = tls.Dial("tcp", this.Hco.Address.GetHostOnly(), &tls.Config{
InsecureSkipVerify: this.Hco.SkipVerifyTLS,
})
} else { } else {
this.conn, err = net.Dial("tcp", this.Hco.Address.GetHostOnly()) this.conn, err = net.Dial("tcp", this.Hco.Address.GetHostOnly())
} }