MCPcopy Create free account
hub / github.com/cloudflare/cfssl / createTransport

Method createTransport

api/client/client.go:108–131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106}
107
108func (srv *server) createTransport() *http.Transport {
109 // Start with defaults from http.DefaultTransport
110 transport := &http.Transport{
111 Proxy: http.ProxyFromEnvironment,
112 DialContext: (&net.Dialer{
113 Timeout: 30 * time.Second,
114 KeepAlive: 30 * time.Second,
115 DualStack: true,
116 }).DialContext,
117 MaxIdleConns: 100,
118 IdleConnTimeout: 90 * time.Second,
119 TLSHandshakeTimeout: 10 * time.Second,
120 ExpectContinueTimeout: 1 * time.Second,
121 }
122 // Setup HTTPS client
123 tlsConfig := srv.TLSConfig
124 tlsConfig.BuildNameToCertificate()
125 transport.TLSClientConfig = tlsConfig
126 // Setup Proxy
127 if srv.proxy != nil {
128 transport.Proxy = srv.proxy
129 }
130 return transport
131}
132
133// post connects to the remote server and returns a Response struct
134func (srv *server) post(url string, jsonData []byte) (*api.Response, error) {

Callers 1

postMethod · 0.95

Calls 1

Tested by

no test coverage detected