Fields:
verify: Verification mode (TlsVerify.REQUIRED by default).
ca_bundle: Path to a PEM CA bundle. Defaults to the pixi-managed
$CONDA_PREFIX/ssl/cacert.pem; empty string falls
back to the OpenSSL system default.
cert_file: Path to a PEM client certificate (mTLS), or "" for none.
key_file: Path to a PEM client private key (mTLS), or "" for none.
server_name: SNI hostname override. "" means derive from the
connected host at runtime (strongly preferred).
alpn: Application-Layer Protocol Negotiation protocol IDs to
advertise on the TLS ClientHello in preference order
(e.g. ["h2", "http/1.1"] to prefer HTTP/2 with
fallback). Empty list (the default) disables ALPN
entirely. Per RFC 7301, each ID must be 1..255 bytes
and the wire-format blob (length-prefixed
concatenation) must total at most 255 bytes.
Example:
# Default: verify server cert against pixi CA bundle
var cfg = TlsConfig()
# Custom CA for self-signed certs
var cfg = TlsConfig(ca_bundle="/etc/myapp/ca.pem")
# Mutual TLS (mTLS)
var cfg = TlsConfig(
cert_file="/etc/myapp/client.pem",
key_file="/etc/myapp/client.key",
)
# HTTP/2-preferring client with HTTP/1.1 fallback
var cfg = TlsConfig(alpn=["h2", "http/1.1"])
__init__
def __init__(out self, verify: Int = Int(1), ca_bundle: String = "", cert_file: String = "", key_file: String = "", server_name: String = "", var alpn: List[String] = List(), enable_session_resumption: Bool = True)