Skip to content

Commit

Permalink
Make insecure arg optional
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljanes committed Nov 28, 2023
1 parent 2912a0a commit f9179f1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/py/flwr/client/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def start_client(
client: Optional[Client] = None,
grpc_max_message_length: int = GRPC_MAX_MESSAGE_LENGTH,
root_certificates: Optional[Union[bytes, str]] = None,
insecure: bool = True,
insecure: Optional[bool] = None,
transport: Optional[str] = None,
) -> None:
"""Start a Flower client node which connects to a Flower server.
Expand Down Expand Up @@ -219,6 +219,9 @@ class `flwr.client.Client` (default: None)
"""
event(EventType.START_CLIENT_ENTER)

if insecure is None:
insecure = True if root_certificates is None else False

if load_callable_fn is None:
_check_actionable_client(client, client_fn)

Expand Down Expand Up @@ -312,7 +315,7 @@ def start_numpy_client(
client: NumPyClient,
grpc_max_message_length: int = GRPC_MAX_MESSAGE_LENGTH,
root_certificates: Optional[bytes] = None,
insecure: bool = True,
insecure: Optional[bool] = None,
transport: Optional[str] = None,
) -> None:
"""Start a Flower NumPyClient which connects to a gRPC server.
Expand All @@ -336,7 +339,7 @@ def start_numpy_client(
The PEM-encoded root certificates as a byte string or a path string.
If provided, a secure connection using the certificates will be
established to an SSL-enabled Flower server.
insecure : bool (default: True)
insecure : Optional[bool] (default: None)
Starts an insecure gRPC connection when True. Enables HTTPS connection
when False, using system certificates if `root_certificates` is None.
transport : Optional[str] (default: None)
Expand Down

0 comments on commit f9179f1

Please sign in to comment.