code: func NewEngineAPIClient(config *api.DockerConfig) (*dockerapi.Client, error) {
  	var httpClient *http.Client
  
  	if config.UseTLS || config.TLSVerify {
  		tlscOptions := tlsconfig.Options{
  			InsecureSkipVerify: !config.TLSVerify,
  		}
  
  		if _, err := os.Stat(config.CAFile); !os.IsNotExist(err) {
  			tlscOptions.CAFile = config.CAFile
  		}
  		if _, err := os.Stat(config.CertFile); !os.IsNotExist(err) {
  			tlscOptions.CertFile = config.CertFile
  		}
  		if _, err := os.Stat(config.KeyFile); !os.IsNotExist(err) {
  			tlscOptions.KeyFile = config.KeyFile
  		}
  
  		tlsc, err := tlsconfig.Client(tlscOptions)
  		if err != nil {
  			return nil, err
  		}
  
  		httpClient = &http.Client{
  			Transport: &http.Transport{
  				TLSClientConfig: tlsc,
  			},
  		}
  	}
  	return dockerapi.NewClient(config.Endpoint, os.Getenv("DOCKER_API_VERSION"), httpClient, nil)
  }
docs: // NewEngineAPIClient creates a new Docker engine API client