2018-02-05 16:05:59 -05:00
|
|
|
package client // import "github.com/docker/docker/client"
|
2016-09-08 23:44:25 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/tls"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2016-12-20 06:14:41 -05:00
|
|
|
// resolveTLSConfig attempts to resolve the TLS configuration from the
|
2016-09-08 23:44:25 -04:00
|
|
|
// RoundTripper.
|
2016-09-21 22:16:44 -04:00
|
|
|
func resolveTLSConfig(transport http.RoundTripper) *tls.Config {
|
2016-09-08 23:44:25 -04:00
|
|
|
switch tr := transport.(type) {
|
|
|
|
case *http.Transport:
|
2016-09-21 22:16:44 -04:00
|
|
|
return tr.TLSClientConfig
|
2016-09-08 23:44:25 -04:00
|
|
|
default:
|
2016-09-21 22:16:44 -04:00
|
|
|
return nil
|
2016-09-08 23:44:25 -04:00
|
|
|
}
|
|
|
|
}
|