From da92afa51e345eef96b4d525f76de5525afaa411 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 3 Apr 2016 13:17:29 +1200 Subject: [PATCH] libnmdc: add SkipVerifyTLS option --- src/libnmdc/libnmdc.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libnmdc/libnmdc.go b/src/libnmdc/libnmdc.go index 056adb5..029c4d2 100644 --- a/src/libnmdc/libnmdc.go +++ b/src/libnmdc/libnmdc.go @@ -77,6 +77,7 @@ func init() { type HubConnectionOptions struct { Address HubAddress + SkipVerifyTLS bool // using a negative verb, because bools default to false Self UserInfo NickPassword string NumEventsToBuffer uint @@ -344,7 +345,9 @@ func (this *HubConnection) worker() { if this.conn == nil { 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 { this.conn, err = net.Dial("tcp", this.Hco.Address.GetHostOnly()) }