github.com/kyma-project/kyma-environment-broker@v0.0.1/internal/httputil/client.go (about) 1 package httputil 2 3 import ( 4 "crypto/tls" 5 "net/http" 6 "time" 7 ) 8 9 func NewClient(timeoutSec time.Duration, skipCertVerification bool) *http.Client { 10 transport := http.DefaultTransport.(*http.Transport).Clone() 11 transport.TLSClientConfig.InsecureSkipVerify = skipCertVerification 12 13 return &http.Client{ 14 Transport: transport, 15 Timeout: timeoutSec * time.Second, 16 } 17 } 18 19 func NewRenegotiationTLSClient(timeoutSec time.Duration, skipCertVerification bool) *http.Client { 20 transport := http.DefaultTransport.(*http.Transport).Clone() 21 transport.TLSClientConfig.Renegotiation = tls.RenegotiateOnceAsClient 22 transport.TLSClientConfig.InsecureSkipVerify = skipCertVerification 23 24 return &http.Client{ 25 Transport: transport, 26 Timeout: timeoutSec * time.Second, 27 } 28 }