From caae11e473583ce16586d264795369e6be976147 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Tue, 18 Jul 2017 13:36:42 -0700 Subject: [PATCH] transport: include InsecureSkipVerify in TLSInfo Some functions take a TLSInfo to generate a tls.Config and there was no way to force the InsecureSkipVerify flag. --- pkg/transport/listener.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/transport/listener.go b/pkg/transport/listener.go index 12120beaefd7..33ba17fe12dd 100644 --- a/pkg/transport/listener.go +++ b/pkg/transport/listener.go @@ -56,12 +56,13 @@ func wrapTLS(addr, scheme string, tlsinfo *TLSInfo, l net.Listener) (net.Listene } type TLSInfo struct { - CertFile string - KeyFile string - CAFile string - TrustedCAFile string - ClientCertAuth bool - CRLFile string + CertFile string + KeyFile string + CAFile string + TrustedCAFile string + ClientCertAuth bool + CRLFile string + InsecureSkipVerify bool // ServerName ensures the cert matches the given host in case of discovery / virtual hosting ServerName string @@ -236,6 +237,7 @@ func (info TLSInfo) ClientConfig() (*tls.Config, error) { } else { cfg = &tls.Config{ServerName: info.ServerName} } + cfg.InsecureSkipVerify = info.InsecureSkipVerify CAFiles := info.cafiles() if len(CAFiles) > 0 {