From 529ce8b7a8b40ae6971420cfdee5cee4aecbc89e Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Fri, 27 Jun 2025 07:18:54 +0000 Subject: [PATCH] Set http transport config This change sets the github client http transport options to mirror those of the default transport from Go, with the addition of the TLSClientConfig. Signed-off-by: Gabriel Adrian Samfira --- params/params.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/params/params.go b/params/params.go index c9d4fb94..3a0e8435 100644 --- a/params/params.go +++ b/params/params.go @@ -23,6 +23,7 @@ import ( "encoding/pem" "fmt" "math" + "net" "net/http" "time" @@ -912,11 +913,22 @@ func (g ForgeCredentials) GetHTTPClient(ctx context.Context) (*http.Client, erro } } + dialer := &net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + } + httpTransport := &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: dialer.DialContext, TLSClientConfig: &tls.Config{ RootCAs: roots, MinVersion: tls.VersionTLS12, }, + ForceAttemptHTTP2: true, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, } var tc *http.Client