Skip to main content

How to set mTLS configuration in Go

Use the ConnectionOptions API available in the go.temporal.io/sdk/client package to connect a Client with mTLS.

    cert, err := tls.LoadX509KeyPair(clientCertPath, clientKeyPath)
if err != nil {
return err
}
client, err := client.Dial(client.Options{
HostPort: "foo.bar.tmprl.cloud:7233",
Namespace: "foo.bar",
ConnectionOptions: client.ConnectionOptions{
TLS: &tls.Config{Certificates: []tls.Certificate{cert}},
},
})