Skip to content

Commit

Permalink
Fix auth failure on one-way TLS
Browse files Browse the repository at this point in the history
Signed-off-by: Shah, Karan <[email protected]>
  • Loading branch information
MasterSkepticista committed Nov 21, 2024
1 parent 3c983ef commit 7d398fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion openfl/transport/grpc/aggregator_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,12 @@ def validate_collaborator(self, request, context):
not authorized.
"""
if self.tls:
common_name = context.auth_context()["x509_common_name"][0].decode("utf-8")
collaborator_common_name = request.header.sender
if self.disable_client_auth:
common_name = collaborator_common_name
else:
common_name = context.auth_context()["x509_common_name"][0].decode("utf-8")

if not self.aggregator.valid_collaborator_cn_and_id(
common_name, collaborator_common_name
):
Expand Down

0 comments on commit 7d398fa

Please sign in to comment.