diff --git a/builtin/credential/radius/path_config.go b/builtin/credential/radius/path_config.go index 7d4bc8b22ad6..2eaac22bc791 100644 --- a/builtin/credential/radius/path_config.go +++ b/builtin/credential/radius/path_config.go @@ -39,7 +39,7 @@ func pathConfig(b *backend) *framework.Path { "read_timeout": &framework.FieldSchema{ Type: framework.TypeDurationSecond, Default: 10, - Description: "Number of seconds before response times out (default: 10). Note: kept for backwards compatibility, currently unused.", + Description: "Number of seconds before response times out (default: 10)", }, "nas_port": &framework.FieldSchema{ Type: framework.TypeInt, diff --git a/builtin/credential/radius/path_login.go b/builtin/credential/radius/path_login.go index 4e54f0c0c674..39be7df1e8a3 100644 --- a/builtin/credential/radius/path_login.go +++ b/builtin/credential/radius/path_login.go @@ -154,7 +154,9 @@ func (b *backend) RadiusLogin(req *logical.Request, username string, password st Timeout: time.Duration(cfg.DialTimeout) * time.Second, }, } - received, err := client.Exchange(context.Background(), packet, hostport) + ctx, cancelFunc := context.WithTimeout(context.Background(), time.Duration(cfg.ReadTimeout)*time.Second) + received, err := client.Exchange(ctx, packet, hostport) + cancelFunc() if err != nil { return nil, logical.ErrorResponse(err.Error()), nil }