From 706a828e16ff712a4151da76a3522bcc1ba75110 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Thu, 1 Feb 2018 11:47:47 +0800 Subject: [PATCH] copy InsecureSkipVerify from the tls.Config to the mint.Config mint now supports InsecureSkipVerify. --- mint_utils.go | 1 + mint_utils_test.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/mint_utils.go b/mint_utils.go index c80af6b5..7c023a94 100644 --- a/mint_utils.go +++ b/mint_utils.go @@ -74,6 +74,7 @@ func tlsToMintConfig(tlsConf *tls.Config, pers protocol.Perspective) (*mint.Conf } if tlsConf != nil { mconf.ServerName = tlsConf.ServerName + mconf.InsecureSkipVerify = tlsConf.InsecureSkipVerify mconf.Certificates = make([]*mint.Certificate, len(tlsConf.Certificates)) for i, certChain := range tlsConf.Certificates { mconf.Certificates[i] = &mint.Certificate{ diff --git a/mint_utils_test.go b/mint_utils_test.go index 3398299d..ecf9d516 100644 --- a/mint_utils_test.go +++ b/mint_utils_test.go @@ -49,6 +49,13 @@ var _ = Describe("Packing and unpacking Initial packets", func() { Expect(mintConf.ServerName).To(Equal("www.example.com")) }) + It("sets InsecureSkipVerify", func() { + conf := &tls.Config{InsecureSkipVerify: true} + mintConf, err := tlsToMintConfig(conf, protocol.PerspectiveClient) + Expect(err).ToNot(HaveOccurred()) + Expect(mintConf.InsecureSkipVerify).To(BeTrue()) + }) + It("sets the certificate chain", func() { tlsConf := testdata.GetTLSConfig() mintConf, err := tlsToMintConfig(tlsConf, protocol.PerspectiveClient)