Skip to content

Instantly share code, notes, and snippets.

@tfrench
Last active February 27, 2018 10:04
Show Gist options
  • Save tfrench/7232597750790f1db3d963feec44a213 to your computer and use it in GitHub Desktop.
Save tfrench/7232597750790f1db3d963feec44a213 to your computer and use it in GitHub Desktop.
Client code for using SSL and server-side authentication
# 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