Skip to content

Commit

Permalink
Up http client stransport
Browse files Browse the repository at this point in the history
  • Loading branch information
demdxx committed Nov 22, 2024
1 parent af9e9ca commit 6a4ef38
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions storage/ping/pinger.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ping

import (
"crypto/tls"
"net/http"

"github.com/demdxx/gocast/v2"
Expand Down Expand Up @@ -45,8 +46,12 @@ func (p *pinger) Stream(options ...any) (stream.Streamer, error) {
return nil, err
}
// Disable insecure skip verify
httpTransport := http.DefaultTransport.(*http.Transport)
httpTransport.TLSClientConfig.InsecureSkipVerify = false
httpTransport := http.DefaultTransport.(*http.Transport).Clone()
if httpTransport.TLSClientConfig == nil {
httpTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
} else {
httpTransport.TLSClientConfig.InsecureSkipVerify = true
}
// Init stream instance
strm := &pingStream{
url: patternkey.PatternKeyFromTemplate(gocast.Or(strmConf.URL, p.URL)),
Expand Down

0 comments on commit 6a4ef38

Please sign in to comment.