Skip to content

Instantly share code, notes, and snippets.

@nleiva
Created July 17, 2019 20:13
Show Gist options
  • Save nleiva/24665663329d9c97027eeff53ee18bb3 to your computer and use it in GitHub Desktop.
Save nleiva/24665663329d9c97027eeff53ee18bb3 to your computer and use it in GitHub Desktop.
// Client
// ... as in http://bit.ly/go-grpc-tls-ca ...
// Server
tlsConfig := &tls.Config{
GetCertificate: c.GetCertificate,
}
s := grpc.NewServer(grpc.Creds(credentials.NewTLS(tlsConfig)))
// ... register gRPC services ...
if err = s.Serve(lis); err != nil {
log.Fatalf("failed to serve: %v", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment