Skip to main content

How to set mTLS configuration in Python

Use the tls_config parameter from the Client class to connect a Client with mTLS.

The following example connects your Client to your address. The tls_config options uses variables that reference the certificate and private key.

await Client.connect(
"foo.bar.tmprl.cloud",
namespace="foo.bar",
tls_config=TLSConfig(
client_cert=client_cert,
client_private_key=client_private_key,
),
)

The Hello World mTLS sample demonstrates sample code used to connect to a Temporal Cloud account with the argparse library.