Skip to content

This is a simple python gRPC project with mutual server-client tls authentication.

License

Notifications You must be signed in to change notification settings

ferjif/python-grpc-mutual-tls-auth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python gRPC mutual tls authentication

This is a simple python gRPC project with mutual server-client tls authentication.

Goal

A gRPC server that would

  1. accept only trusted clients connections
  2. establish encrypted communication channel

Doc resources and examples

Official gRPC python documentation has a simple example how to establish tls encryption between client and a server. It doesn't talk about how to generate those files or how to establish mutual authentication. In this setup any client can theoretically connect to the server. gRPC library complains if you don't include server certificate but the server doesn't do any kind of authentication by default.

python gRPC reference

Secure gRPC with TLS/SSL - useful article but it still doesn't clarify confusion about tls certs.

Using SSL with gRPC in Python - doesn't talk about mutual tls authentication but has interesting sections on metadata and compression.

TLS authentication in Python gRPC - Very useful explanation and the repo itself is an awesome example of setting up gRPC server and client. I wonder if it's possible to generate all those keys using only openssl though.

Useful openssl stackoverflow post that talks about setting up CA and signing certificates.

Another stackoverflow about managing certificates with openssl.

Common openssl commands

Scope

The scope of the example should include:

  1. A very simple gRPC function
  2. Server and client setup with mutual tls authentication
  3. Management commands (probably using invoke) to create/manage all necessary tls files and run the server

About

This is a simple python gRPC project with mutual server-client tls authentication.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%