Skip to content

Commit

Permalink
Bugfix - Fetch ca cert via ssl package (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wrede authored Oct 31, 2022
1 parent 827515c commit 608d4f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fedn/fedn/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import queue
import re
import ssl
import sys
import tempfile
import threading
Expand Down Expand Up @@ -267,8 +268,9 @@ def _connect(self, client_config):
elif self.config['secure']:
secure = True
print("CLIENT: using CA certificate for GRPC channel")
cert = ssl.get_server_certificate((host, port))

credentials = grpc.ssl_channel_credentials()
credentials = grpc.ssl_channel_credentials(cert.encode('utf-8'))
channel = grpc.secure_channel("{}:{}".format(host, str(port)), credentials)
else:
print("CLIENT: using insecure GRPC channel")
Expand Down

0 comments on commit 608d4f1

Please sign in to comment.