(insecureSkipVerify bool, rootCAs *x509.CertPool, cert *tls.Certificate, timeout *time.Duration)
| 39 | } |
| 40 | |
| 41 | func httpsClient(insecureSkipVerify bool, rootCAs *x509.CertPool, cert *tls.Certificate, timeout *time.Duration) *http.Client { |
| 42 | client := httpClient(timeout) |
| 43 | var certs []tls.Certificate |
| 44 | if cert != nil { |
| 45 | certs = []tls.Certificate{*cert} |
| 46 | } |
| 47 | |
| 48 | var dialer = SOCKS5DialFuncFromEnvironment((&net.Dialer{ |
| 49 | Timeout: 30 * time.Second, |
| 50 | KeepAlive: 30 * time.Second, |
| 51 | }).Dial, proxy.NewSocks5Proxy(proxy.NewHostKey(), nil, 30*time.Second)) |
| 52 | |
| 53 | client.Transport = &http.Transport{ |
| 54 | TLSClientConfig: &tls.Config{ |
| 55 | InsecureSkipVerify: insecureSkipVerify, |
| 56 | PreferServerCipherSuites: true, |
| 57 | Certificates: certs, |
| 58 | RootCAs: rootCAs, |
| 59 | MinVersion: tls.VersionTLS12, |
| 60 | }, |
| 61 | Proxy: http.ProxyFromEnvironment, |
| 62 | Dial: dialer, |
| 63 | MaxIdleConnsPerHost: 100, |
| 64 | } |
| 65 | |
| 66 | return client |
| 67 | } |
no test coverage detected
searching dependent graphs…