Skip to content

Commit

Permalink
Fix bug with common transport TLSSkipVerify
Browse files Browse the repository at this point in the history
I found a bug with setting up TLSSkipVerify from the common transports.
Looks like I put checking for that within the creation of the transport
that only happens once. Therefore, if the transport is created, then it
will never check again if TLSSkipVerify is set. From running my own
tests by hand it seems to be working now.
  • Loading branch information
joereuss12 committed Sep 7, 2023
1 parent b39030e commit 4e4b664
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions handle_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,10 @@ func setupTransport() *http.Transport {
func getTransport() *http.Transport {
onceTransport.Do(func() {
transport = setupTransport()
if viper.GetBool("TLSSkipVerify") {
transport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
}
})
if viper.GetBool("TLSSkipVerify") {
transport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
}
return transport
}

Expand Down

0 comments on commit 4e4b664

Please sign in to comment.