Add TrustTLS method to networkHTTPTransport

This commit is contained in:
9seconds
2026-03-11 23:21:41 +01:00
parent 23aa2eefad
commit c886ffdd81
+12 -1
View File
@@ -1,6 +1,9 @@
package network
import "net/http"
import (
"crypto/tls"
"net/http"
)
type networkHTTPTransport struct {
userAgent string
@@ -12,3 +15,11 @@ func (n networkHTTPTransport) RoundTrip(req *http.Request) (*http.Response, erro
return n.next.RoundTrip(req) //nolint: wrapcheck
}
func (n networkHTTPTransport) TrustTLS() {
tr := n.next.(*http.Transport)
if tr.TLSClientConfig == nil {
tr.TLSClientConfig = &tls.Config{}
}
tr.TLSClientConfig.InsecureSkipVerify = true
}