MCPcopy Index your code
hub / github.com/PasarGuard/node / CreateHTTPClient

Function CreateHTTPClient

pkg/tlsutil/tls.go:42–54  ·  view source on GitHub ↗
(certPool *x509.CertPool, hostname string)

Source from the content-addressed store, hash-verified

40}
41
42func CreateHTTPClient(certPool *x509.CertPool, hostname string) *http.Client {
43 tlsConfig := &tls.Config{RootCAs: certPool, ServerName: hostname}
44 transport := &http.Transport{
45 TLSClientConfig: tlsConfig,
46 Protocols: new(http.Protocols),
47 }
48 transport.Protocols.SetHTTP2(true)
49
50 return &http.Client{
51 Transport: transport,
52 Timeout: 10 * time.Second,
53 }
54}

Callers 1

TestMainFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestMainFunction · 0.74