Server and Dial options
We touched upon ServerOption
and DialOption
briefly with the grpc.ServerOption
object and the grpc.WithTransportCredentials
function. However, there are a lot of other options you can choose from. For readability’s sake, I will not go into detail about every one of them, but I want to present some major options that you will probably use. All ServerOptions
can be found at the root of the grpc-go
repository in the file called server.go
(https://github.com/grpc/grpc-go/blob/master/server.go) and the DialOptions
in the file called dialoptions.go
(https://github.com/grpc/grpc-go/blob/master/dialoptions.go).
grpc.Creds
This is an option, on both the server and client sides, that we will use when we talk about securing APIs. For now, we saw that we can call grpc.WithTransportCredentials
with an insecure.NewCredentials
result, and this gives us an insecure connection. This means that none of the requests and responses are encrypted; anyone could intercept...