Created
July 18, 2019 14:55
-
-
Save nleiva/90f5bd042763f9b6bca9acbaae993288 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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