Merge pull request #440 from gabriel-samfira/forward-port-439

Set http transport config
This commit is contained in:
Gabriel 2025-06-27 11:27:48 +03:00 committed by GitHub
commit 25e7befa08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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