(gateway *Gateway)
| 438 | } |
| 439 | |
| 440 | func makeHTTPTransport(gateway *Gateway) { |
| 441 | |
| 442 | var x509TrustedCerts []*x509.Certificate |
| 443 | |
| 444 | if len(gateway.trustedCerts) > 0 { |
| 445 | for _, tlsCert := range gateway.trustedCerts { |
| 446 | x509Cert, _ := x509.ParseCertificate(tlsCert.Certificate[0]) |
| 447 | x509TrustedCerts = append(x509TrustedCerts, x509Cert) |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | gateway.transport = &http.Transport{ |
| 452 | DisableKeepAlives: true, |
| 453 | Dial: (&net.Dialer{ |
| 454 | KeepAlive: 30 * time.Second, |
| 455 | Timeout: gateway.DialTimeout, |
| 456 | }).Dial, |
| 457 | TLSClientConfig: util.NewTLSConfig(x509TrustedCerts, gateway.config.IsSSLDisabled()), |
| 458 | Proxy: http.ProxyFromEnvironment, |
| 459 | } |
| 460 | } |
| 461 | |
| 462 | func dialTimeout(envDialTimeout string) time.Duration { |
| 463 | dialTimeout := DefaultDialTimeout |
no test coverage detected