Skip to content

Commit

Permalink
Merge pull request #257 from sipcapture/tls
Browse files Browse the repository at this point in the history
added flag to skip validation
  • Loading branch information
adubovikov authored Aug 11, 2023
2 parents 851dedc + 86d52a5 commit 32d2ad7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type Config struct {
Reassembly bool
SendRetries uint
Version bool
SkipVerify bool
}

type InterfacesConfig struct {
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/sipcapture/heplify/sniffer"
)

const version = "heplify 1.65.5"
const version = "heplify 1.65.6"

func createFlags() {

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion publish/hep.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 32d2ad7

Please sign in to comment.