Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,16 @@ func (c *Config) CheckAndSetDefaults() error {
PermitWithoutStream: true,
}))
if !c.DialInBackground {
c.DialOpts = append(c.DialOpts, grpc.WithBlock())
c.DialOpts = append(
c.DialOpts,
// Provides additional feedback on connection failure, otherwise,
// users will only receive a `context deadline exceeded` error when
// c.DialInBackground == false.
//
// grpc.WithReturnConnectionError implies grpc.WithBlock which is
// necessary for connection route selection to work properly.
grpc.WithReturnConnectionError(),
)
}
return nil
}
Expand Down
7 changes: 0 additions & 7 deletions docs/pages/api/automatically-register-agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -799,9 +799,6 @@ func newTokenDemoApp() *tokenDemoApp {
t, err := teleport.New(ctx, teleport.Config{
Addrs: []string{proxyAddr},
Credentials: []teleport.Credentials{creds},
DialOpts: []grpc.DialOption{
grpc.WithReturnConnectionError(),
},
})
if err != nil {
panic(err)
Expand Down Expand Up @@ -830,10 +827,6 @@ up an API client. Our plugin initializes a Teleport client by calling
`client.Credentials` to call `client.New`, which connects to the Teleport Proxy
Service specified in the `Addrs` field using the provided identity file.

In this example, we are passing the `grpc.WithReturnConnectionError()` function
call to `client.New`, which instructs the gRPC client to return more detailed
connection errors.

<Admonition type="warning">

This program does not validate your credentials or Teleport cluster address.
Expand Down
7 changes: 0 additions & 7 deletions docs/pages/api/rbac.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,6 @@ func main() {
teleport, err := client.New(ctx, client.Config{
Addrs: []string{proxyAddr},
Credentials: []client.Credentials{creds},
DialOpts: []grpc.DialOption{
grpc.WithReturnConnectionError(),
},
})
if err != nil {
panic(err)
Expand Down Expand Up @@ -783,10 +780,6 @@ initializes a Teleport client by calling `client.LoadIdentityFile` to obtain a
`client.New`, which connects to the Teleport Proxy Service specified in the
`Addrs` field using the provided identity file.

In this example, we are passing the `grpc.WithReturnConnectionError()` function
call to `client.New`, which instructs the gRPC client to return more detailed
connection errors.

<Admonition type="warning">

This program does not validate your credentials or Teleport cluster address.
Expand Down