2016-09-09 03:44:25 +00:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/tls"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2016-12-20 11:14:41 +00:00
|
|
|
// resolveTLSConfig attempts to resolve the TLS configuration from the
|
2016-09-09 03:44:25 +00:00
|
|
|
// RoundTripper.
|
2016-09-22 02:16:44 +00:00
|
|
|
func resolveTLSConfig(transport http.RoundTripper) *tls.Config {
|
2016-09-09 03:44:25 +00:00
|
|
|
switch tr := transport.(type) {
|
|
|
|
case *http.Transport:
|
2016-09-22 02:16:44 +00:00
|
|
|
return tr.TLSClientConfig
|
2016-09-09 03:44:25 +00:00
|
|
|
default:
|
2016-09-22 02:16:44 +00:00
|
|
|
return nil
|
2016-09-09 03:44:25 +00:00
|
|
|
}
|
|
|
|
}
|