mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 16:59:22 +02:00
zero/grpc: use hostname for proxied grpc calls (#5521)
zero/grpc: use hostname for proxied grpc calls (#5520) Co-authored-by: Denis Mishin <dmishin@pomerium.com>
This commit is contained in:
parent
a55c144ca1
commit
e23caa50cf
4 changed files with 18 additions and 11 deletions
|
@ -48,6 +48,7 @@ func New(
|
|||
func (c *client) getGRPCConn(ctx context.Context) (*grpc.ClientConn, error) {
|
||||
opts := append(
|
||||
c.config.GetDialOptions(),
|
||||
grpc.WithAuthority(c.config.GetAuthority()),
|
||||
grpc.WithPerRPCCredentials(c),
|
||||
grpc.WithDefaultCallOptions(
|
||||
grpc.UseCompressor("gzip"),
|
||||
|
@ -60,7 +61,7 @@ func (c *client) getGRPCConn(ctx context.Context) (*grpc.ClientConn, error) {
|
|||
),
|
||||
)
|
||||
|
||||
conn, err := grpc.DialContext(ctx, c.config.GetConnectionURI(), opts...)
|
||||
conn, err := grpc.NewClient(c.config.GetConnectionURI(), opts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error dialing grpc server: %w", err)
|
||||
}
|
||||
|
@ -92,7 +93,7 @@ func (c *client) logConnectionState(ctx context.Context, conn *grpc.ClientConn)
|
|||
_ = conn.WaitForStateChange(ctx, state)
|
||||
state = conn.GetState()
|
||||
log.Ctx(ctx).Debug().
|
||||
Str("endpoint", c.config.connectionURI).
|
||||
Str("endpoint", c.config.GetConnectionURI()).
|
||||
Str("state", state.String()).
|
||||
Msg("grpc connection state")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue