Skip to content

Commit 1e718f4

Browse files
committed
feat(temporal): add TEMPORAL_TLS_ENABLED to override gRPC TLS setting
Allows Temporal connection to use different TLS settings than other gRPC clients. Useful when internal Temporal doesn't use TLS but other gRPC services do.
1 parent 3bcce97 commit 1e718f4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

temporal/temporal.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ import (
4040
// - GRPC_CLIENT_TLS_ENABLED: Enable TLS (default: false)
4141
// - GRPC_CLIENT_TIMEOUT: Request timeout (default: 10s)
4242
//
43+
// Temporal-specific overrides:
44+
// - TEMPORAL_TLS_ENABLED: Override TLS for Temporal connection (optional, uses GRPC_CLIENT_TLS_ENABLED if not set)
45+
//
4346
// Reference: https://docs.temporal.io/develop/go/temporal-client
4447
func New(
4548
l logger.Logger,
@@ -55,6 +58,11 @@ func New(
5558
namespace := cfg.GetString("TEMPORAL_NAMESPACE")
5659
identity := cfg.GetString("TEMPORAL_IDENTITY")
5760

61+
// Override TLS setting for Temporal if TEMPORAL_TLS_ENABLED is explicitly set
62+
if cfg.IsSet("TEMPORAL_TLS_ENABLED") {
63+
cfg.Set("GRPC_CLIENT_TLS_ENABLED", cfg.GetBool("TEMPORAL_TLS_ENABLED"))
64+
}
65+
5866
// Build gRPC dial options using go-sdk/grpc
5967
grpcOpts := []sdkgrpc.Option{
6068
sdkgrpc.WithLogger(l),

0 commit comments

Comments
 (0)