GRPC client and server secure communication secured using mutual TLS (mTLS).
- move to certs directory
- run ./gen_certs.sh which will generate all of the keys and certificates
- create client-ext.conf and server-ext.conf files and add the IP so that a connection can be developed on the local side (subjectAltName=IP:0.0.0.0)
- add -extfile server-ext.conf to line 30 and -extfile client-ext.conf to line 54 of the gen_certs.sh file otherwise we get this error when running "2022/08/02 10:20:19 rpc error: code = Unavailable desc = connection error: desc = "transport: authentication handshake failed: x509: cannot validate certificate for 0.0.0.0 because it doesn't contain any IP SANs" exit status 1"
- then open a split terminal, one within the server directory, and the other within the client directory
- use the following command on the server side first: go run server.go
- followed by: go run client.go on the client side and the connection should be established properly and a greeting should be printed