0

Is it possible to set the VAULT_CLIENT_TIMEOUT CLI environment variable with a curl API request?

Maybe exist some header to set this variable (like X-Vault-Token)? I can't find any information about this in official documentation.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

0

No, it is not possible to set VAULT_CLIENT_TIMEOUT via an API call because it is a value that the Vault command line client reads. The server ignores it. The server will not timeout if the processing takes too much time, it relies on the client for that.

You could set the environment variable like this to have a 20s timeout:

export VAULT_CLIENT_TIMEOUT=20

Or if you are using cURL, you can use the --max-time 20 option to get the same effect.

Finally, if you are using an API wrapper to call Vault, check the documentation to see if it honors the VAULT_CLIENT_TIMEOUT environment variable or not. If not, it might have a way to specify a timeout value at the http level.

ixe013
  • 9,559
  • 3
  • 46
  • 77