2424class ClientConfigTLSDict (TypedDict , total = False ):
2525 """Dictionary representation of TLS config for TOML."""
2626
27- disabled : bool
27+ disabled : Optional [ bool ]
2828 server_name : str
2929 server_ca_cert : Mapping [str , str ]
3030 client_cert : Mapping [str , str ]
@@ -105,8 +105,8 @@ class ClientConfigTLS:
105105 Experimental API.
106106 """
107107
108- disabled : bool = False
109- """If true , TLS is explicitly disabled."""
108+ disabled : Optional [ bool ] = None
109+ """If True , TLS is explicitly disabled. If False, TLS is explicitly enabled. If None, TLS behavior was not configured ."""
110110 server_name : Optional [str ] = None
111111 """SNI override."""
112112 server_root_ca_cert : Optional [DataSource ] = None
@@ -119,7 +119,7 @@ class ClientConfigTLS:
119119 def to_dict (self ) -> ClientConfigTLSDict :
120120 """Convert to a dictionary that can be used for TOML serialization."""
121121 d : ClientConfigTLSDict = {}
122- if self .disabled :
122+ if self .disabled is not None :
123123 d ["disabled" ] = self .disabled
124124 if self .server_name is not None :
125125 d ["server_name" ] = self .server_name
@@ -138,7 +138,7 @@ def set_source(
138138
139139 def to_connect_tls_config (self ) -> Union [bool , temporalio .service .TLSConfig ]:
140140 """Create a `temporalio.service.TLSConfig` from this profile."""
141- if self .disabled :
141+ if self .disabled is True :
142142 return False
143143
144144 return temporalio .service .TLSConfig (
@@ -154,7 +154,7 @@ def from_dict(d: Optional[ClientConfigTLSDict]) -> Optional[ClientConfigTLS]:
154154 if not d :
155155 return None
156156 return ClientConfigTLS (
157- disabled = d .get ("disabled" , False ),
157+ disabled = d .get ("disabled" ),
158158 server_name = d .get ("server_name" ),
159159 # Note: Bridge uses snake_case, but TOML uses kebab-case which is
160160 # converted to snake_case. Core has server_ca_cert, client_key.
@@ -238,7 +238,10 @@ def to_client_connect_config(self) -> ClientConnectConfig:
238238 config ["namespace" ] = self .namespace
239239 if self .api_key is not None :
240240 config ["api_key" ] = self .api_key
241+ # Enable TLS with default TLS options
242+ config ["tls" ] = True
241243 if self .tls is not None :
244+ # Use specified TLS options
242245 config ["tls" ] = self .tls .to_connect_tls_config ()
243246 if self .grpc_meta :
244247 config ["rpc_metadata" ] = self .grpc_meta
@@ -333,7 +336,6 @@ def from_dict(
333336 def load (
334337 * ,
335338 config_source : Optional [DataSource ] = None ,
336- disable_file : bool = False ,
337339 config_file_strict : bool = False ,
338340 override_env_vars : Optional [Mapping [str , str ]] = None ,
339341 ) -> ClientConfig :
@@ -348,8 +350,6 @@ def load(
348350 config_source: If present, this is used as the configuration source
349351 instead of default file locations. This can be a path to the file
350352 or the string/byte contents of the file.
351- disable_file: If true, file loading is disabled. This is only used
352- when ``config_source`` is not present.
353353 config_file_strict: If true, will TOML file parsing will error on
354354 unrecognized keys.
355355 override_env_vars: The environment variables to use for locating the
@@ -364,7 +364,6 @@ def load(
364364 loaded_profiles = _bridge_envconfig .load_client_config (
365365 path = path ,
366366 data = data ,
367- disable_file = disable_file ,
368367 config_file_strict = config_file_strict ,
369368 env_vars = override_env_vars ,
370369 )
0 commit comments