Documentation
¶
Overview ¶
Package transport is what every outbound HTTPS and TLS client of komando shares, so the environment never decides where a login goes:
- Certificates are checked against the system's CAs. SSL_CERT_FILE and SSL_CERT_DIR are ignored on every system (roots.go): with its own CA there and its proxy in HTTPS_PROXY, an AI agent would read a stored VPN password, a cluster token or a registry login.
- The company proxy (HTTPS_PROXY, HTTP_PROXY, NO_PROXY) is used, as curl, kubectl and docker do, when a person runs komando. When an AI agent runs it, the environment is the agent's, and no proxy is taken from it (DistrustEnv). A proxy written in a config file the person keeps (a kubeconfig's proxy-url) still counts.
- HTTP builds the clients' http.Transport, and Dial opens raw TCP tunnels through the proxy for the connections http.Transport does not make itself (stream upgrades, SSL VPN tunnels).
A connection that goes through a --via path never uses these proxies: the path is its way out.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
func Dial(ctx context.Context, pick Func, dial Dialer, target *url.URL, addr string) (net.Conn, error)
Dial opens a TCP connection to addr (the host:port of target) through the proxy that pick chooses for target, or straight with dial when pick is nil or chooses none. dial also reaches the proxy.
func DistrustEnv ¶
func DistrustEnv() (undo func())
DistrustEnv says the environment of this process is an AI agent's: no proxy, and no CA a client library would read from it (AWS_CA_BUNDLE, VAULT_CACERT), is taken from it. The komando program calls it for an agent; an app's calls never reach its process environment. undo is for tests.
func EnvDistrusted ¶
func EnvDistrusted() bool
EnvDistrusted reports whether the environment is an AI agent's.
func HTTP ¶
HTTP is a new http.Transport for a client of komando, with the timeouts of Go's default one and TLS 1.2 or later. It has no proxy: a client that connects straight (no --via path) sets Proxy to Proxy(), or to the proxy a person's config file names.