This is a small example of how to use mutal TLS with gRPC. It includes an example of a unary interceptor so that you can whitelist methods that do not require a valid client certificate.
This is example code so it does not include tests, has hard-coded values all over the place and includes the generated gRPC code.
This project uses make for building. To ensure you have the required build dependencies installed you can perform a
make install-depsbefore you execute
buildBinaries will be put in the bin subdirectory.
Before you run the server you have to generate the CA, server and client keys. You can do this by running
bin/genkeysThen you can start the server
bin/serverand then run the client
bin/client