tls-rustls only.Expand description
TLS connector via rustls, and the HTTP client every HTTP call shares.
When the tls-rustls feature is enabled, this module provides HTTPS
support using [hyper_rustls]. No OpenSSL system dependency is required.
§What is trusted
default_tls_config trusts Mozilla’s roots (webpki-roots) plus, when
set, the PEM certificates in the file SSL_CERT_FILE names and in the
directory SSL_CERT_DIR names (each a :-separated list on Unix), the
variables curl, OpenSSL and Go read. That is how a container image’s CA
bundle (SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt), a corporate
TLS-inspecting proxy’s root, or a cluster’s private CA reaches every HTTP
call the client makes without code. A file that cannot be read or parsed
is reported once and skipped; it never removes Mozilla’s roots.
In code, tls_config_from_pem builds a config with extra roots and, for
mutual TLS, a client certificate, and
ClientBuilder::with_tls_config
gives it to the client. Until 2026-10-29 the JSON-RPC and HTTP+JSON
transports ignored every TLS setting and trusted Mozilla’s roots only,
so an agent behind a private CA could not be reached over either (audit
B-01).
§Proxies
HttpsClient goes through the proxy HTTPS_PROXY, HTTP_PROXY,
ALL_PROXY and NO_PROXY name (see the crate’s proxy module docs).
Structs§
- Client
Config - Common configuration for (typically) all connections made by a program.
- Https
Client - The HTTPS-capable HTTP client the transports, card discovery, JWKS and the token provider use: rustls, and the environment’s proxy.
Functions§
- build_
https_ client_ with_ config - Builds an HTTPS-capable hyper client using a custom TLS configuration and the default connection timeout.
- build_
https_ client_ with_ connect_ timeout - Builds an HTTPS-capable hyper client with a custom TLS configuration and connection timeout applied to the underlying TCP connector.
- default_
tls_ config - Builds a default
ClientConfigwith Mozilla root certificates. - tls_
config_ from_ pem - Builds a
ClientConfigfrom PEM: extra roots and a client identity. - tls_
config_ with_ extra_ roots - Builds a
ClientConfigwith extra CA certificates added to the rootsdefault_tls_configtrusts.