You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/03-concepts/14-mutual-tls.md
+122-5Lines changed: 122 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,14 +75,131 @@ The mTLS handshake process involves the following steps:
75
75
76
76
---
77
77
78
+
## Implementing mTLS in Cadence
79
+
80
+
### Server Configuration
81
+
82
+
To enable mTLS in Cadence server, you need to configure TLS settings and start the server with the appropriate environment configuration.
83
+
84
+
#### Starting the Server with TLS
85
+
86
+
Use the `--zone` flag to specify the TLS configuration when starting the Cadence server:
87
+
88
+
```bash
89
+
./cadence-server --env development --zone tls start
90
+
```
91
+
92
+
**Command breakdown:**
93
+
-`--env development`: Specifies the environment configuration to use (corresponds to `config/development.yaml`)
94
+
-`--zone tls`: Specifies the zone configuration to use (corresponds to the `tls` zone in `development_tls.yaml`)
95
+
-`start`: Starts all Cadence services
96
+
97
+
The `--zone tls` flag tells the server to load additional configuration from the zone-specific file. In this case, it will look for `config/development_tls.yaml` which contains the TLS-specific settings.
98
+
99
+
#### TLS Configuration File
100
+
101
+
The server uses a YAML configuration file to define TLS settings. Here's an example from [`development_tls.yaml`](https://github.com/cadence-workflow/cadence/blob/master/config/development_tls.yaml):
102
+
103
+
```bash
104
+
services:
105
+
frontend:
106
+
rpc:
107
+
tls:
108
+
enabled: true
109
+
certFile: config/credentials/keytest.crt
110
+
keyFile: config/credentials/keytest
111
+
caFiles:
112
+
- config/credentials/client.crt
113
+
requireClientAuth: true
114
+
115
+
matching:
116
+
rpc:
117
+
tls:
118
+
enabled: true
119
+
certFile: config/credentials/keytest.crt
120
+
keyFile: config/credentials/keytest
121
+
122
+
history:
123
+
rpc:
124
+
tls:
125
+
enabled: true
126
+
certFile: config/credentials/keytest.crt
127
+
keyFile: config/credentials/keytest
128
+
129
+
clusterGroupMetadata:
130
+
clusterGroup:
131
+
cluster0:
132
+
tls:
133
+
enabled: true
134
+
135
+
```
136
+
---
137
+
138
+
### Client Implementation
139
+
140
+
To connect a Cadence client with mTLS, you need to configure TLS credentials and pass them to the Cadence client. Here's the essential code from the [helloworld_tls sample](https://github.com/cadence-workflow/cadence-samples/blob/master/new_samples/client_samples/helloworld_tls/hello_world_tls.go):
For a complete working example with detailed code and configuration, refer to the [helloworld_tls sample](https://github.com/cadence-workflow/cadence-samples/tree/master/new_samples/client_samples/helloworld_tls) in the Cadence samples repository. This sample demonstrates how to:
195
+
The [helloworld_tls sample](https://github.com/cadence-workflow/cadence-samples/tree/master/new_samples/client_samples/helloworld_tls) provides a complete, tested implementation of mTLS with Cadence, including:
196
+
197
+
- Certificate generation scripts
198
+
- Complete client implementation with mTLS
199
+
- Instructions for running with a TLS-enabled server
200
+
- Step-by-step setup guide
81
201
82
-
- Generate test certificates using OpenSSL
83
-
- Configure both server and client for mTLS
84
-
- Implement a simple workflow with mTLS authentication
85
-
- Test the mTLS connection
202
+
For additional server configuration examples, refer to the [Cadence server repository](https://github.com/cadence-workflow/cadence)
0 commit comments