Last active
February 27, 2018 10:04
-
-
Save tfrench/7232597750790f1db3d963feec44a213 to your computer and use it in GitHub Desktop.
Client code for using SSL and server-side authentication
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read in certificate | |
with open('server.crt', 'rb') as f: | |
trusted_certs = f.read() | |
# create credentials | |
credentials = grpc.ssl_channel_credentials(root_certificates=trusted_certs) | |
# create channel using ssl credentials | |
channel = grpc.secure_channel('{}:{}'.format(host, port), credentials) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment