Skip to content

Conversation

@flxkid
Copy link

@flxkid flxkid commented Jan 16, 2026

Summary

Adds a configurable timeout parameter for Azure Key Vault connections to prevent long waits when the Key Vault URL is unreachable.

Changes

  • Added --azure-key-vault-timeout parameter (alias: -kvto) with default of 30 seconds
  • Returns standard Windows ERROR_TIMEOUT (0x800705B5) when connection times out
  • Uses CancellationTokenSource to enforce timeout on certificate retrieval operations
  • Added validation for timeout parameter (must be positive integer)

Motivation

Previously, the program would wait several minutes (potentially 3-5+ minutes with retries) when the Key Vault URL was unreachable, using the default Azure SDK HTTP timeout of ~100 seconds plus retry attempts. This change allows users to fail fast with a configurable timeout. When using the tool in an automated build environment, a timeout parameter (especially a short one) can be critical.

Testing

Tested with unreachable Key Vault URL to verify:

  • Timeout behavior works correctly
  • Returns standard Windows ERROR_TIMEOUT error code (-2147023435)
  • Default 30-second timeout is reasonable
  • Custom timeout values work as expected

Breaking Changes

Standard behavior was a 100s timeout with 3 retries. This changes it to a 30s timeout without a retry. This seems like a much more sane default than potentially (and often) five minutes of frozen time and then failure when the server can't be contacted. In general if a server can't be contacted in 30s it's not going to be contacted in longer either.

- Add --azure-key-vault-timeout parameter (default: 30 seconds)
- Return standard Windows ERROR_TIMEOUT (0x800705B5) on timeout
- Prevent long waits when Key Vault URL is unreachable
- Use CancellationTokenSource to enforce timeout on certificate retrieval operations

Resolves issue where the program would wait several minutes when Key Vault URL cannot be reached.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant