From 86d52a589c9dc6e9a0001ffdc60424e57af212df Mon Sep 17 00:00:00 2001 From: Alexandr Dubovikov Date: Fri, 11 Aug 2023 10:19:14 +0200 Subject: [PATCH] added flag to skip validation --- config/config.go | 1 + main.go | 3 ++- publish/hep.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 290ac7c..e26df4a 100644 --- a/config/config.go +++ b/config/config.go @@ -29,6 +29,7 @@ type Config struct { Reassembly bool SendRetries uint Version bool + SkipVerify bool } type InterfacesConfig struct { diff --git a/main.go b/main.go index 59b0fe3..1e8d78b 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ import ( "github.com/sipcapture/heplify/sniffer" ) -const version = "heplify 1.65.5" +const version = "heplify 1.65.6" func createFlags() { @@ -77,6 +77,7 @@ func createFlags() { flag.BoolVar(&config.Cfg.Reassembly, "tcpassembly", false, "If true, tcpassembly will be enabled") flag.UintVar(&config.Cfg.SendRetries, "tcpsendretries", 64, "Number of retries for sending before giving up and reconnecting") flag.BoolVar(&config.Cfg.Version, "version", false, "Show heplify version") + flag.BoolVar(&config.Cfg.SkipVerify, "skipverify", false, "skip certifcate validation") flag.Parse() config.Cfg.Iface = &ifaceConfig diff --git a/publish/hep.go b/publish/hep.go index 9788158..9e2faf4 100644 --- a/publish/hep.go +++ b/publish/hep.go @@ -72,7 +72,7 @@ func (h *HEPOutputer) ConnectServer(n int) (err error) { return err } } else if config.Cfg.Network == "tls" { - if h.client[n].conn, err = tls.Dial("tcp", h.addr[n], &tls.Config{InsecureSkipVerify: true}); err != nil { + if h.client[n].conn, err = tls.Dial("tcp", h.addr[n], &tls.Config{InsecureSkipVerify: config.Cfg.SkipVerify}); err != nil { return err } } else {