mirror of
https://github.com/SSLMate/certspotter.git
synced 2025-06-27 10:15:33 +02:00
Improve http.Client configuration
Ensure HTTP/2 can be used. Set IdleConnTimeout to the net/http default. Remove MaxIdleConns limit so that connections are more likely to be reused.
This commit is contained in:
parent
0ba3b07bd9
commit
bdc589762a
@ -32,9 +32,7 @@ func NewHTTPClient(dialContext func(context.Context, string, string) (net.Conn,
|
||||
TLSHandshakeTimeout: 15 * time.Second,
|
||||
ResponseHeaderTimeout: 30 * time.Second,
|
||||
MaxIdleConnsPerHost: 10,
|
||||
DisableKeepAlives: false,
|
||||
MaxIdleConns: 100,
|
||||
IdleConnTimeout: 15 * time.Second,
|
||||
IdleConnTimeout: 90 * time.Second,
|
||||
ExpectContinueTimeout: 1 * time.Second,
|
||||
TLSClientConfig: &tls.Config{
|
||||
// We have to disable TLS certificate validation because because several logs
|
||||
@ -47,6 +45,7 @@ func NewHTTPClient(dialContext func(context.Context, string, string) (net.Conn,
|
||||
InsecureSkipVerify: true,
|
||||
},
|
||||
DialContext: dialContext,
|
||||
ForceAttemptHTTP2: true,
|
||||
},
|
||||
CheckRedirect: func(*http.Request, []*http.Request) error {
|
||||
return errors.New("redirects not followed")
|
||||
|
Loading…
x
Reference in New Issue
Block a user