Example of an authenticated gRPC & grpc-gateway HTTP server, and various client connection examples.
- Install Go 1.23 from https://golang.org/
- Run
make compile
to compile the server & client code.
make run-server
-
make run-client
runs a gRPC client that sends a token-authenticated request to the gRPC endpoint. -
make run-client-alice
runs a gRPC client that sends a mTLS request to the gRPC endpoint using Alice's certificate & key. -
make run-client-bob
runs a gRPC client that sends a mTLS request to the gRPC endpoint using Bob's certificate & key. It will fail since Bob's certificate is not permitted. -
make run-curl
invokes curl to send a token-authenticated request to the HTTP server. -
make run-curl-alice
invokes curl to send a mTLS request to the HTTP server using Alice's certificate & key. -
make run-curl-bob
invokes curl to send a mTLS request to the HTTP server using Bob's certificate & key. It will fail since Bob's certificate is not permitted. -
make run-grpcurl
invokes grpcurl to send a token-authenticated request to the gRPC server. -
make run-grpcurl-alice
invokes grpcurl to send a mTLS request to the gRPC server using Alice's certificate & key. -
make run-grpcurl-bob
invokes grpcurl to send a mTLS request to the gRPC server using Bob's certificate & key. It will fail since Bob's certificate is not permitted.
Run make genproto
from the root of this project's directory.