Skip to content

Instantly share code, notes, and snippets.

@nleiva
Created July 18, 2019 14:55
Show Gist options
  • Save nleiva/90f5bd042763f9b6bca9acbaae993288 to your computer and use it in GitHub Desktop.
Save nleiva/90f5bd042763f9b6bca9acbaae993288 to your computer and use it in GitHub Desktop.
// Client
config := &tls.Config{}
conn, err := grpc.Dial(address, grpc.WithTransportCredentials(credentials.NewTLS(config)))
if err != nil {
log.Fatalf("did not connect: %v", err)
}
defer conn.Close()
// Server
creds := credentials.NewTLS(manager.TLSConfig())
s := grpc.NewServer(grpc.Creds(creds))
// ... register gRPC services ...
// Listener...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment