Files
gluetun/internal/provider/privateinternetaccess/httpclient.go
Quentin McGaw db91625de4 fix(pia): port forwarding certificate
- Do not use custom PIA certificate
- Only use OS certificates
- Update unit test
2022-04-25 08:31:27 +00:00

33 lines
748 B
Go

package privateinternetaccess
import (
"crypto/tls"
"net"
"net/http"
"time"
)
func newHTTPClient(serverName string) (client *http.Client) {
//nolint:gomnd
return &http.Client{
Transport: &http.Transport{
// Settings taken from http.DefaultTransport
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).DialContext,
ForceAttemptHTTP2: true,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS12,
ServerName: serverName,
},
},
Timeout: 30 * time.Second,
}
}