Skip to content

Latest commit

 

History

History
57 lines (44 loc) · 1.56 KB

README.md

File metadata and controls

57 lines (44 loc) · 1.56 KB

Secure-gRPC

Build Status

Go-lang: Secure Bi-Directional GRPC streaming server & client example using SSL/TLS to find max number from the stream.

How to run

Run Server

$ cd server
$ go run server.go

Run Client

$ cd client
$ go run client.go

Output

text

Guide to generate proto and certs

Step 1: Proto Generation:

$ cd proto
$ protoc --go_out=plugins=grpc:. *.proto

Step 2: Cert Generation:

$ git clone https://github.com/square/certstrap
$ cd certstrap
$ ./build
$ ./bin/certstrap-master-linux-amd64 init --common-name "akbar.com"
Created out/akbar.com.key
Created out/akbar.com.crt
Created out/akbar.com.crl
$ ./bin/certstrap-master-linux-amd64 request-cert --common-name client
$ ./bin/certstrap-master-linux-amd64 sign out/client --CA akbar.com 

$ ./bin/certstrap-master-linux-amd64 request-cert --common-name server
$ ./bin/certstrap-master-linux-amd64 sign out/server --CA akbar.com

The above files will be generated inside the /out folder

  • Copy akbar.com.crt, server.crt and server.key to secure-grpc/server/cert folder
  • Copy akbar.com.crt, client.crt and client.key to secure-grpc/client/cert folder

Happy Coding!