on cmd/serve.go: (line 84)
https://github.com/philips/grpc-gateway-example/blob/master/cmd/serve.go#L84
dcreds := credentials.NewTLS(&tls.Config{ ServerName: demoAddr, RootCAs: demoCertPool, })
demoAddr is used for creating the credentials. demoAddr is an endpoint with address:port format. Using that will cause your TLS to look for a serverName of "localhost:10000". Hence, in your certificate, you had to add the domain:port specifically as a server name. It is not good practice to use a specific name in your cert. The ServerName should be only the Address.
on cmd/serve.go: (line 84)
https://github.com/philips/grpc-gateway-example/blob/master/cmd/serve.go#L84
dcreds := credentials.NewTLS(&tls.Config{ ServerName: demoAddr, RootCAs: demoCertPool, })demoAddr is used for creating the credentials. demoAddr is an endpoint with address:port format. Using that will cause your TLS to look for a serverName of "localhost:10000". Hence, in your certificate, you had to add the domain:port specifically as a server name. It is not good practice to use a specific name in your cert. The ServerName should be only the Address.