diff --git a/agent/agent.go b/agent/agent.go index 8d21db7c22..35403a1453 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -525,7 +525,13 @@ func (a *Agent) listenAndServeGRPC() error { a.xdsServer.Initialize() var err error - a.grpcServer, err = a.xdsServer.GRPCServer(a.config.CertFile, a.config.KeyFile) + if a.config.HTTPSPort > 0 { + // gRPC uses the same TLS settings as the HTTPS API. If HTTPS is + // enabled then gRPC will require HTTPS as well. + a.grpcServer, err = a.xdsServer.GRPCServer(a.config.CertFile, a.config.KeyFile) + } else { + a.grpcServer, err = a.xdsServer.GRPCServer("", "") + } if err != nil { return err }